public NetworkRole(ObjectRole roles)
 {
     _includedObjectRoles = roles;
     // Authority is mostly mutually exlusive with the Others role so
     // it is excluded unless it is explicitely included.
     if (roles.IsOther() && !roles.IsAuthority())
     {
         _excludedObjectRoles = ObjectRole.Authority;
     }
     else
     {
         _excludedObjectRoles = ObjectRole.Nobody;
     }
 }
예제 #2
0
 public static void IntoList(this ObjectRole role, IList <ObjectRole> roles)
 {
     roles.Clear();
     if (role.IsOwner())
     {
         roles.Add(ObjectRole.Owner);
     }
     if (role.IsAuthority())
     {
         roles.Add(ObjectRole.Authority);
     }
     if (role.IsOther())
     {
         roles.Add(ObjectRole.Others);
     }
 }