C# Class wmib.Security

Afficher le fichier Open project: benapetr/wikimedia-bot Class Usage Examples

Méthodes publiques

Свойство Type Description
Roles Role>.Dictionary
Users List

Méthodes publiques

Méthode Description
AddUser ( string level, string user ) : bool

Add

Auth ( string User, string Password ) : SystemUser

Verify the users credentials and if they are correct, returns a user instance

DeleteUser ( SystemUser origin, string user ) : void

Delete user

Dump ( ) : string
EscapeUser ( string name ) : string

Normalize user

GetGlobalUser ( string user ) : SystemUser

Gets the global user. Work just as GetUser, but only for global records

GetLevel ( libirc user ) : int

Return a level of role that this user posses

GetLevelOfRole ( string role ) : int
GetNameOfRole ( Security role ) : string
GetUser ( libirc user ) : SystemUser
GetUser ( string user ) : SystemUser

Return user object from a name Search all global and local records for matching regex, if multiple matches are existing the one with highest privileges is returned.

Global ( ) : void

Load a global list

Init ( ) : void

Load all roles

InsertUser ( XmlNode node ) : void
IsApproved ( libirc user, string command ) : bool

Check if user is approved to do operation requested

IsApproved ( string User, string Host, string privilege ) : bool

Check if user is approved to do operation requested

IsGloballyApproved ( SystemUser user, string permission ) : bool
IsGloballyApproved ( libirc user, string permission ) : bool
IsKnown ( libirc user ) : bool
IsKnown ( string User, string Host ) : bool
IsRole ( string name ) : bool
ListAll ( ) : string

List all users to a channel

Save ( ) : bool

Save

Security ( Channel channel ) : System

Private Methods

Méthode Description
GlobalChanged ( object sender, EventArgs e ) : void

This is called when the file is changed

GlobalLoad ( ) : void

Load all global users of bot

HasPrivilege ( string privilege, string role ) : bool

Method Details

AddUser() public méthode

Add
public AddUser ( string level, string user ) : bool
level string Level
user string Regex
Résultat bool

Auth() public static méthode

Verify the users credentials and if they are correct, returns a user instance
public static Auth ( string User, string Password ) : SystemUser
User string Username
Password string Password
Résultat SystemUser

DeleteUser() public méthode

Delete user
public DeleteUser ( SystemUser origin, string user ) : void
origin SystemUser
user string Regex
Résultat void

Dump() public static méthode

public static Dump ( ) : string
Résultat string

EscapeUser() public static méthode

Normalize user
public static EscapeUser ( string name ) : string
name string
Résultat string

GetGlobalUser() public static méthode

Gets the global user. Work just as GetUser, but only for global records
public static GetGlobalUser ( string user ) : SystemUser
user string /// Identification string against which the user regexes are tested, this is usually a string /// in format of 'nick!ident@hostname' ///
Résultat SystemUser

GetLevel() public méthode

Return a level of role that this user posses
public GetLevel ( libirc user ) : int
user libirc
Résultat int

GetLevelOfRole() public static méthode

public static GetLevelOfRole ( string role ) : int
role string
Résultat int

GetNameOfRole() public static méthode

public static GetNameOfRole ( Security role ) : string
role Security
Résultat string

GetUser() public méthode

public GetUser ( libirc user ) : SystemUser
user libirc
Résultat SystemUser

GetUser() public méthode

Return user object from a name Search all global and local records for matching regex, if multiple matches are existing the one with highest privileges is returned.
public GetUser ( string user ) : SystemUser
user string /// Identification string against which the user regexes are tested, this is usually a string /// in format of nick!ident@hostname (typical for IRC protocol) ///
Résultat SystemUser

Global() public static méthode

Load a global list
public static Global ( ) : void
Résultat void

Init() public static méthode

Load all roles
public static Init ( ) : void
Résultat void

InsertUser() public méthode

public InsertUser ( XmlNode node ) : void
node System.Xml.XmlNode
Résultat void

IsApproved() public méthode

Check if user is approved to do operation requested
public IsApproved ( libirc user, string command ) : bool
user libirc
command string
Résultat bool

IsApproved() public méthode

Check if user is approved to do operation requested
public IsApproved ( string User, string Host, string privilege ) : bool
User string Username
Host string Hostname
privilege string Approved for specified object / request
Résultat bool

IsGloballyApproved() public static méthode

public static IsGloballyApproved ( SystemUser user, string permission ) : bool
user SystemUser
permission string
Résultat bool

IsGloballyApproved() public static méthode

public static IsGloballyApproved ( libirc user, string permission ) : bool
user libirc
permission string
Résultat bool

IsKnown() public méthode

public IsKnown ( libirc user ) : bool
user libirc
Résultat bool

IsKnown() public méthode

public IsKnown ( string User, string Host ) : bool
User string
Host string
Résultat bool

IsRole() public static méthode

public static IsRole ( string name ) : bool
name string
Résultat bool

ListAll() public méthode

List all users to a channel
public ListAll ( ) : string
Résultat string

Save() public méthode

Save
public Save ( ) : bool
Résultat bool

Security() public méthode

public Security ( Channel channel ) : System
channel Channel
Résultat System

Property Details

Roles public_oe static_oe property

public static Dictionary Roles
Résultat Role>.Dictionary

Users public_oe property

List of all users in a channel
public List Users
Résultat List