public static bool CanSetPrivate(Authentication authentication, IPermissionDescriptor descriptor) { if (descriptor.AccessInfo.IsPrivate == true && descriptor.AccessInfo.IsInherited == false) { return(false); } return(descriptor.AccessType >= AccessType.Owner); }
public static bool CanLock(Authentication authentication, IPermissionDescriptor descriptor) { if (descriptor.LockInfo.IsLocked == true && descriptor.LockInfo.IsInherited == false) { return(false); } return(descriptor.AccessInfo.GetAccessType(authentication.ID) >= AccessType.Editor || authentication.Authority == Authority.Admin); }
public static bool CanUnlock(Authentication authentication, IPermissionDescriptor descriptor) { if (descriptor.LockInfo.IsLocked == false || descriptor.LockInfo.IsInherited == true) { return(false); } return(descriptor.LockInfo.IsOwner(authentication.ID) == true); }
public static bool IsLockInherited(Authentication authentication, IPermissionDescriptor descriptor) { return(descriptor.LockInfo.IsInherited); }
public static bool IsLockOwner(Authentication authentication, IPermissionDescriptor descriptor) { return(descriptor.LockInfo.IsOwner(authentication.ID)); }
public static bool IsAccessMember(Authentication authentication, IPermissionDescriptor descriptor) { return(descriptor.AccessInfo.IsMember(authentication.ID)); }
public static bool IsPrivate(Authentication authentication, IPermissionDescriptor descriptor) { return(descriptor.AccessInfo.IsPrivate); }