Inheritance: Chaos.Portal.Core.Data.Model.AResult
Exemplo n.º 1
0
 private static void SetEntityPermission(IDictionary<Guid, FolderPermission> entityPermissions, Guid entityGuid, FolderPermission permission)
 {
     if (entityPermissions.ContainsKey(entityGuid))
         entityPermissions[entityGuid] = entityPermissions[entityGuid].Or(permission);
     else
         entityPermissions.Add(entityGuid, permission);
 }
Exemplo n.º 2
0
 private bool UserHasPemissionToFolder(Guid userGuid, FolderPermission permission)
 {
     return UserPermissions.ContainsKey(userGuid) && (UserPermissions[userGuid] & permission) == permission;
 }
Exemplo n.º 3
0
 private bool GroupsHavePermissionToFolder(IEnumerable<Guid> groupGuids, FolderPermission permission)
 {
     return groupGuids.Any(groupGuid => GroupPermissions.ContainsKey(groupGuid) && (GroupPermissions[groupGuid] & permission) == permission);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Return true if user or group has permission to folder
 /// </summary>
 /// <param name="userGuid"></param>
 /// <param name="groupGuids"></param>
 /// <param name="permission"></param>
 /// <returns></returns>
 public bool DoesUserOrGroupHavePermission(Guid userGuid, IEnumerable<Guid> groupGuids, FolderPermission permission)
 {
     return UserHasPemissionToFolder(userGuid, permission) || GroupsHavePermissionToFolder(groupGuids, permission);
 }