public bool CanRevoke(PlayerInfo player) { PermissionLimits limits = GetLimit(player); if (limits == null) { return(false); } else { return(limits.CanRevoke); } }
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); } }
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); } }
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); } }
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; } }
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; } }