| AJS 4.x
Manual | Note! This Manual is for the "Windows authentication" version, which is designed to work with existing Windows server or Active Directory accounts and Windows authentication. If you want to create accounts by yourself and store their credentials in your own HTTP Commander XML database, you need to download the "Forms authentication" version! This Manual is for the Windows authentication version only! | Web file manager Free Installation assistance Manual Home page

Manual and programmatic configuration of Folders and Users

1. Manual folders and users setup at Notepad
2. Setup users and folders programmatically

Manual folders and users setup at Notepad

Manual folders setup (without Admin panel)
You can setup folders for users in the Data\Folders.xml file. It has XML format and you can use any text editor to edit it (e.g. Notepad).
If you don't know XML or have other problems with manual folders setup, use the Admin panel online tool. See available values of folders' paths, user names in the Admin panel online tool description as well.
Below is the example of Folders.xml default content. It provides access to "%APPROOT%\DemoFolder\Folder1" for demo user and %APPROOT%\DemoFolder\Folder2 for admin group.
<?xml version="1.0" encoding="utf-8"?> <Folders> <Folder> <Name>Demo folder 1</Name> <Location>%APPROOT%\DemoFolder\Folder1</Location> <UserPermissions> <Permission> <IdentityName>demo</IdentityName> <Create>true</Create> <Delete>true</Delete> <Rename>true</Rename> <Upload>true</Upload> <Download>true</Download> <ZipDownload>true</ZipDownload> <Zip>true</Zip> <Unzip>true</Unzip> <Cut>true</Cut> <Copy>true</Copy> <ListFiles>true</ListFiles> <ListFolders>true</ListFolders> <ListRestriction> <Type>Deny</Type> <Extensions /> </ListRestriction> <CreateRestriction> <Type>Deny</Type> <Extensions /> </CreateRestriction> </Permission> </UserPermissions> <GroupPermissions> <Permission> <IdentityName>admins</IdentityName> <Create>true</Create> <Delete>true</Delete> <Rename>true</Rename> <Upload>true</Upload> <Download>true</Download> <ZipDownload>true</ZipDownload> <Zip>true</Zip> <Unzip>true</Unzip> <Cut>true</Cut> <Copy>true</Copy> <ListFiles>true</ListFiles> <ListFolders>true</ListFolders> <ListRestriction> <Type>Deny</Type> <Extensions /> </ListRestriction> <CreateRestriction> <Type>Deny</Type> <Extensions /> </CreateRestriction> </Permission> </GroupPermissions> </Folder> <Folder> <Name>Folder 2</Name> <Location>%APPROOT%\DemoFolder\Folder2</Location> <UserPermissions> <Permission> <IdentityName>demo</IdentityName> <Create>true</Create> <Delete>true</Delete> <Rename>true</Rename> <Upload>true</Upload> <Download>true</Download> <ZipDownload>true</ZipDownload> <Zip>true</Zip> <Unzip>true</Unzip> <Cut>true</Cut> <Copy>true</Copy> <ListFiles>true</ListFiles> <ListFolders>true</ListFolders> <ListRestriction> <Type>Deny</Type> <Extensions> <string>EXE</string> <string>BAT</string> <string>ASPX</string> <string>PHP</string> </Extensions> </ListRestriction> <CreateRestriction> <Type>Deny</Type> <Extensions> <string>EXE</string> <string>BAT</string> <string>ASPX</string> <string>PHP</string> </Extensions> </CreateRestriction> </Permission> </UserPermissions> <GroupPermissions> <Permission> <IdentityName>admins</IdentityName> <Create>true</Create> <Delete>true</Delete> <Rename>true</Rename> <Upload>true</Upload> <Download>true</Download> <ZipDownload>true</ZipDownload> <Zip>true</Zip> <Unzip>true</Unzip> <Cut>true</Cut> <Copy>true</Copy> <ListFiles>true</ListFiles> <ListFolders>true</ListFolders> <ListRestriction> <Type>Deny</Type> <Extensions /> </ListRestriction> <CreateRestriction> <Type>Deny</Type> <Extensions /> </CreateRestriction> </Permission> </GroupPermissions> </Folder> </Folders>

Setup users and folders programmatically

You can setup users, their authentication, permissions and folders programmatically. I.e you don't need to use Admin panel and built-in XML files for storing data. This is needed if you have own database of users or you want programmatically setup users and folders.
All you need is to edit open source files:

- Global.asax stores sample code to setup users and folders. You should uncomment code in Application_Start event to use programmatic setup.

Below is the example of building list users, groups programmatically.
// Create some folders Folder DemoFolder1 = new Folder("Demo folder 1", @"%APPROOT%\DemoFolder\Folder1"), Folder2 = new Folder("Folder 2", @"%APPROOT%\DemoFolder\Folder2"), HomeDrive = new Folder("Home drive", "%HOME%"), AdminTestFolder = new Folder("Admin test folder", @"%APPROOT%\DemoFolder\%USERNAME%"), DomainUsersDemoFolder = new Folder("Domain users demo folder", @"%APPROOT%\DemoFolder\%GROUPNAME%"); // Add of the additional information for a DemoFolder1 DemoFolder1.Description = ""; DemoFolder1.CustomField = ""; // Create full permissions for some users and groups UserPermissions AdministratorUserPermission = new UserPermissions(AccountUtils.GetUserIdentity("Administrator")); GroupPermissions AdministratorsPermission = new GroupPermissions(AccountUtils.GetGroupIdentity("Administrators")); GroupPermissions DomainUsersPermission = new GroupPermissions(AccountUtils.GetGroupIdentity("Domain Users")); GroupPermissions DomainAdminsPermission = new GroupPermissions(AccountUtils.GetGroupIdentity("Domain Admins")); GroupPermissions UsersPermissions = new GroupPermissions(AccountUtils.GetGroupIdentity("Users")); //// Create special permissions for Folder2: // for DomainUsers GroupPermissions DomainUsersPermissionFolder2 = new GroupPermissions(AccountUtils.GetGroupIdentity("Domain Users")); DomainUsersPermissionFolder2.Create = true; DomainUsersPermissionFolder2.Delete = true; DomainUsersPermissionFolder2.Rename = true; DomainUsersPermissionFolder2.Upload = true; DomainUsersPermissionFolder2.Download = true; DomainUsersPermissionFolder2.ZipDownload = true; DomainUsersPermissionFolder2.Zip = true; DomainUsersPermissionFolder2.Unzip = true; DomainUsersPermissionFolder2.Cut = true; DomainUsersPermissionFolder2.Copy = true; DomainUsersPermissionFolder2.Modify = true; DomainUsersPermissionFolder2.ListFiles = true; DomainUsersPermissionFolder2.ListFolders = true; FileTypeRestriction Deny_EXE_BAT_ASPX = new FileTypeRestriction(RestrictionType.Deny, new string[] { "EXE", "BAT", "ASPX" }); DomainUsersPermissionFolder2.ListRestriction = Deny_EXE_BAT_ASPX; DomainUsersPermissionFolder2.CreateRestriction = Deny_EXE_BAT_ASPX; DomainUsersPermissionFolder2.customField = ""; // for Users GroupPermissions UsersPermissionFolder2 = new GroupPermissions(AccountUtils.GetGroupIdentity("Users")); UsersPermissionFolder2.ListRestriction = UsersPermissionFolder2.CreateRestriction = Deny_EXE_BAT_ASPX; //// Assign permissions to the folders: // DemoFolder1 DemoFolder1.UserPermissions.Add(AdministratorUserPermission); DemoFolder1.GroupPermissions.Add(DomainUsersPermission); DemoFolder1.GroupPermissions.Add(DomainAdminsPermission); DemoFolder1.GroupPermissions.Add(UsersPermissions); DemoFolder1.GroupPermissions.Add(AdministratorsPermission); // Folder2 Folder2.UserPermissions.Add(AdministratorUserPermission); Folder2.GroupPermissions.Add(DomainUsersPermissionFolder2); Folder2.GroupPermissions.Add(DomainAdminsPermission); Folder2.GroupPermissions.Add(UsersPermissionFolder2); Folder2.GroupPermissions.Add(AdministratorsPermission); // HomeDrive HomeDrive.UserPermissions.Add(AdministratorUserPermission); HomeDrive.GroupPermissions.Add(DomainUsersPermission); // AdminTestFolder AdminTestFolder.UserPermissions.Add(AdministratorUserPermission); // DomainUsersDemoFolder DomainUsersDemoFolder.GroupPermissions.Add(DomainUsersPermission); // Add created folders to the list List<Folder> folderList = new List<Folder>(); folderList.Add(DemoFolder1); folderList.Add(Folder2); folderList.Add(HomeDrive); folderList.Add(AdminTestFolder); folderList.Add(DomainUsersDemoFolder); // Set SimpleAccountManager and SimpleFolderManager as work classes Utils.ConcreteSimpleAccountManager = new SimpleAccountManager(); Utils.ConcreteSimpleFolderManager = new SimpleFolderManager(folderList);