コード例 #1
0
        public bool CanRevoke(PlayerInfo player)
        {
            PermissionLimits limits = GetLimit(player);

            if (limits == null)
            {
                return(false);
            }
            else
            {
                return(limits.CanRevoke);
            }
        }
コード例 #2
0
        public bool Can(PlayerInfo player, int quantity)
        {
            if ((Node.Flags & PermissionFlags.NeedsQuantity) == 0)
            {
                throw new PermissionCheckException("Quantity limit is not applicable to " + Node.Name);
            }
            PermissionLimits limits = GetLimit(player);

            if (limits == null)
            {
                return(false);
            }
            else
            {
                return(limits.MaxQuantity <= quantity);
            }
        }
コード例 #3
0
 public PermissionOverride Include(string name, PermissionLimits limits)
 {
     if (playerInclusions.ContainsKey(name))
     {
         return(PermissionOverride.Allow);
     }
     else if (playerExclusions.Contains(name))
     {
         playerExclusions.Remove(name);
         return(PermissionOverride.Deny);
     }
     else
     {
         playerInclusions.Add(name, limits);
         return(PermissionOverride.None);
     }
 }
コード例 #4
0
 public PermissionOverride Include(Rank rank, PermissionLimits limits)
 {
     if (rankInclusions.ContainsKey(rank))
     {
         return(PermissionOverride.Allow);
     }
     else if (rankExclusions.Contains(rank))
     {
         rankExclusions.Remove(rank);
         return(PermissionOverride.Deny);
     }
     else
     {
         rankInclusions.Add(rank, limits);
         return(PermissionOverride.None);
     }
 }
コード例 #5
0
        public PermissionOverride Include( string name, PermissionLimits limits ) {
            if( playerInclusions.ContainsKey( name ) ) {
                return PermissionOverride.Allow;

            } else if( playerExclusions.Contains( name ) ) {
                playerExclusions.Remove( name );
                return PermissionOverride.Deny;

            } else {
                playerInclusions.Add( name, limits );
                return PermissionOverride.None;
            }
        }
コード例 #6
0
        public PermissionOverride Include( Rank rank, PermissionLimits limits ) {
            if( rankInclusions.ContainsKey( rank ) ) {
                return PermissionOverride.Allow;

            } else if( rankExclusions.Contains( rank ) ) {
                rankExclusions.Remove( rank );
                return PermissionOverride.Deny;

            } else {
                rankInclusions.Add( rank, limits );
                return PermissionOverride.None;
            }
        }