![]() |
TrinityCore
|
#include <RBAC.h>
Public Member Functions | |||||
| RBACData (uint32 id, std::string const &name, int32 realmId, uint8 secLevel=255) | |||||
| std::string const & | GetName () const | ||||
| Gets the Name of the Object. More... | |||||
| uint32 | GetId () const | ||||
| Gets the Id of the Object. More... | |||||
HasPermission | |||||
Checks if certain action is allowed Checks if certain action can be performed.
Example Usage: | |||||
| bool | HasPermission (uint32 permission) const | ||||
| RBACPermissionContainer const & | GetPermissions () const | ||||
| Returns all the granted permissions (after computation) More... | |||||
| RBACPermissionContainer const & | GetGrantedPermissions () const | ||||
| Returns all the granted permissions. More... | |||||
| RBACPermissionContainer const & | GetDeniedPermissions () const | ||||
| Returns all the denied permissions. More... | |||||
GrantRole | |||||
Grants a permission Grants a permission to the account. If realm is 0 or the permission can not be added No save to db action will be performed. Fails if permission Id does not exists or permission already granted or denied
Example Usage: // previously defined "RBACData* rbac" with proper initialization
uint32 permissionId = 2;
| |||||
| RBACCommandResult | GrantPermission (uint32 permissionId, int32 realmId=0) | ||||
DenyPermission | |||||
Denies a permission Denied a permission to the account. If realm is 0 or the permission can not be added No save to db action will be performed. Fails if permission Id does not exists or permission already granted or denied
Example Usage: // previously defined "RBACData* rbac" with proper initialization
uint32 permissionId = 2;
| |||||
| RBACCommandResult | DenyPermission (uint32 permissionId, int32 realmId=0) | ||||
Private Member Functions | |
CalculateNewPermissions | |
Calculates new permissions Calculates new permissions after some change The calculation is done Granted - Denied:
| |
| void | CalculateNewPermissions () |
| int32 | GetRealmId () const |
| bool | HasGrantedPermission (uint32 permissionId) const |
| Checks if a permission is granted. More... | |
| bool | HasDeniedPermission (uint32 permissionId) const |
| Checks if a permission is denied. More... | |
| void | AddGrantedPermission (uint32 permissionId) |
| Adds a new granted permission. More... | |
| void | RemoveGrantedPermission (uint32 permissionId) |
| Removes a granted permission. More... | |
| void | AddDeniedPermission (uint32 permissionId) |
| Adds a new denied permission. More... | |
| void | RemoveDeniedPermission (uint32 permissionId) |
| Removes a denied permission. More... | |
| void | AddPermissions (RBACPermissionContainer const &permsFrom, RBACPermissionContainer &permsTo) |
| Adds a list of permissions to another list. More... | |
| void | RemovePermissions (RBACPermissionContainer &permsFrom, RBACPermissionContainer const &permsToRemove) |
| Removes a list of permissions from another list. More... | |
RevokePermission | |||||
|
Removes a permission from the account. If realm is 0 or the permission can not be removed No save to db action will be performed. Any delete operation will always affect "all realms (-1)" in addition to the realm specified Fails if permission not present
Example Usage: // previously defined "RBACData* rbac" with proper initialization
uint32 permissionId = 2;
| |||||
| RBACCommandResult | RevokePermission (uint32 permissionId, int32 realmId=0) | ||||
| void | LoadFromDB () | ||||
| Loads all permissions assigned to current account. More... | |||||
| PreparedQueryResultFuture | LoadFromDBAsync () | ||||
| void | LoadFromDBCallback (PreparedQueryResult result) | ||||
| void | SetSecurityLevel (uint8 id) | ||||
| Sets security level. More... | |||||
| uint8 | GetSecurityLevel () const | ||||
| Returns the security level assigned. More... | |||||
| void | SavePermission (uint32 role, bool granted, int32 realm) | ||||
| Saves a permission to DB, Granted or Denied. More... | |||||
| void | ClearData () | ||||
| Clears roles, groups and permissions - Used for reload. More... | |||||
ExpandPermissions | |||
Adds the list of linked permissions to the original list Given a list of permissions, gets all the inherited permissions
| |||
| uint32 | _id | ||
| std::string | _name | ||
More... | |||
| int32 | _realmId | ||
More... | |||
| uint8 | _secLevel | ||
More... | |||
| RBACPermissionContainer | _grantedPerms | ||
More... | |||
| RBACPermissionContainer | _deniedPerms | ||
More... | |||
| RBACPermissionContainer | _globalPerms | ||
More... | |||
| void | ExpandPermissions (RBACPermissionContainer &permissions) | ||
|
inline |
|
inlineprivate |
Adds a new denied permission.
Here is the caller graph for this function:
|
inlineprivate |
Adds a new granted permission.
Here is the caller graph for this function:
|
private |
|
private |
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Clears roles, groups and permissions - Used for reload.
Here is the caller graph for this function:| RBACCommandResult rbac::RBACData::DenyPermission | ( | uint32 | permissionId, |
| int32 | realmId = 0 |
||
| ) |
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Returns all the denied permissions.
Here is the caller graph for this function:
|
inline |
Returns all the granted permissions.
Here is the caller graph for this function:
|
inline |
|
inline |
|
inline |
Returns all the granted permissions (after computation)
|
inlineprivate |
Here is the caller graph for this function:
|
inline |
Returns the security level assigned.
Here is the caller graph for this function:| RBACCommandResult rbac::RBACData::GrantPermission | ( | uint32 | permissionId, |
| int32 | realmId = 0 |
||
| ) |
Here is the call graph for this function:
Here is the caller graph for this function:Checks if a permission is denied.
Here is the caller graph for this function:Checks if a permission is granted.
Here is the caller graph for this function:
Here is the caller graph for this function:| void rbac::RBACData::LoadFromDB | ( | ) |
Loads all permissions assigned to current account.
Here is the call graph for this function:
Here is the caller graph for this function:| PreparedQueryResultFuture rbac::RBACData::LoadFromDBAsync | ( | ) |
Here is the call graph for this function:| void rbac::RBACData::LoadFromDBCallback | ( | PreparedQueryResult | result | ) |
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
Removes a denied permission.
Here is the caller graph for this function:
|
inlineprivate |
Removes a granted permission.
Here is the caller graph for this function:
|
private |
| RBACCommandResult rbac::RBACData::RevokePermission | ( | uint32 | permissionId, |
| int32 | realmId = 0 |
||
| ) |
Here is the call graph for this function:
Here is the caller graph for this function:Saves a permission to DB, Granted or Denied.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Sets security level.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Granted permissions
|
private |
Denied permissions
|
private |
Account SecurityLevel
|
private |
|
private |
Account id
|
private |
Account name
|
private |
RealmId Affected
1.8.8