I am using DMX v6.1.3 and am trying to add a folder and set permissions using the API. The following function is adding the folder correctly, but not setting any permissions. I am guessing it is because I am doing something wrong with the EntryPermissionCollection. public EntryInfo AddPropertyDocumentRepository(PortalSettings portalSettings, string propertyName) { var locale = System.Threading.Thread.CurrentThread.CurrentCulture.Name; var portalId = portalSettings.PortalId; var propertiesFolder = API.GetFolderByPath(portalSettings.PortalId, 0, "Properties", locale , true); var propertyRole = GetPropertyRole(portalId, propertyName); //TODO: These permissions are not being saved with the new folder. It may be because the EntryID is -1. var permissions = new EntryPermissionCollection(); permissions.AddPermission(portalSettings.PortalId, -1 , "VIEW", propertyRole.RoleID, -10); permissions.AddPermission(portalSettings.PortalId, -1 , "EDIT", propertyRole.RoleID, -10); permissions.AddPermission(portalSettings.PortalId, -1 , "ADD", propertyRole.RoleID, -10); //TODO: Need to add permissions for the 'Administrators' role. permissions.AddPermission(portalSettings.PortalId, -1, "VIEW", portalSettings.AdministratorRoleId, -10); permissions.AddPermission(portalSettings.PortalId, -1, "EDIT", portalSettings.AdministratorRoleId, -10); permissions.AddPermission(portalSettings.PortalId, -1, "ADD", portalSettings.AdministratorRoleId, -10); var propertyFolder = API.AddFolder(portalSettings.PortalId, propertiesFolder.EntryId, propertyName, portalSettings.UserInfo, permissions); return propertyFolder; } |