| |
- __builtin__.object
-
- PlayerAccess
- exceptions.Exception(exceptions.BaseException)
-
- InputError
class PlayerAccess(__builtin__.object) |
|
The purpose of this class is to simplify the access to the data parsed by the libary. It is possible to use the Admin object directly, however, unless it's not avoidable this class should be preferred. |
|
Methods defined here:
- CanTarget(self, userid)
- This functions checks whether the user can target the player with the specified userid with an admin command. Depending on sm_immunity_mode the according value may vary. See SourceMod documentation for more info on what sm_immunity_mode changes.
@userid - The userid of the targeted player
Returns True if the user can target the specified userid with an admin command.
Returns False if the user does not exist or if the userid can not be targeted by the user.
- GetImmunity(self)
- This function is used to receive the immunity level of the user. It will always return the highest applicable immnunity.
Returns the immunity value of th euser
Returns False otherwise
- HasFlag(self, adminflag='')
- This functions checks whether the user has the specified flag. It also checks against whether he has root access and thus is able to use the function without having the flag itself.
@adminflag - A single character which represents the admin flag.
Returns True if the user has the specified flag or has root access.
Returns False if the user does not exist or if the flag can not be found.
Raises TypeError if adminflag is not a string.
- HasFlags(self, adminflags=())
- This functions checks whether the user has all specified flag. It also checks against whether he has root access and thus is able to use the function without having the flag itself.
@adminflags - Any iterable type (dict, list, tuple or strings)
Returns True if the user has all the specified flags (or root flag).
Returns False if the has one of the specified flags or if the flag can not be found.
Raises TypeError if the type is invalid.
- InGroup(self, group)
- This functions checks whether the user is in the specifed admin group. This functino is case-senstive.
@group - The admin group
Returns True if the user is in the specified group.
Returns False if the user does not exist or if the group can not be found.
- IsAdmin(self)
- Checks whether the user has basic admin access (b) or not.
Returns True if the user has the basic admin (b) flag
Returns False if the user does not exist or if the flag can not be found.
- IsRoot(self)
- Checks whether the user has root admin access (z) or not.
Returns True if the user has root access.
Returns False otherwise.
- IsUser(self)
- Checks whether the user is stored in the database
Returns True if the user with the specified auth is stored in admin files
Returns False otherwise
- __init__(self, userid, authtype='steam')
- Creates a new player object for the specified userid.
@userid - The userid of the player
@authtype - The authtype that is used when checking permissions. Can be either steam, ip or name (Default: steam)
Raises InputError if the type is invalid (not steam, ip or name)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- authinfo = None
- authtype = None
- user = None
- userid = None
| |