AccessControlFacet
Inherits: IAccessControl, AccessControlBase, Facet
Functions
AccessControl_init
setFunctionAccess
Sets the function access for a given role.
Parameters
Name | Type | Description |
---|---|---|
|
| The function signature to set access for. |
|
| The role to set access for. |
|
| Whether the role should be able to call the function. |
setUserRole
Sets the role for a given user.
Parameters
Name | Type | Description |
---|---|---|
|
| The user to set the role for. |
|
| The role to set. |
|
| Whether the user should have the role. |
canCall
Checks whether a given user can call a given function.
Parameters
Name | Type | Description |
---|---|---|
|
| The user to check. |
|
| The function signature to check. |
Returns
Name | Type | Description |
---|---|---|
|
| Whether the user can call the function. |
userRoles
Gets the roles for a given user.
Parameters
Name | Type | Description |
---|---|---|
|
| The user to get the roles for. |
Returns
Name | Type | Description |
---|---|---|
|
| The roles the user has encoded in 256 bits. |
functionRoles
Gets the roles that can call a given function.
Parameters
Name | Type | Description |
---|---|---|
|
| The function signature to get the roles for. |
Returns
Name | Type | Description |
---|---|---|
|
| The roles that can call the function encoded in 256 bits. |
hasRole
Checks whether a given user has a given role.
Parameters
Name | Type | Description |
---|---|---|
|
| The user to check. |
|
| The role to check. |
Returns
Name | Type | Description |
---|---|---|
|
| Whether the user has the role. |
roleHasAccess
Checks whether a given role can call a given function.
Parameters
Name | Type | Description |
---|---|---|
|
| The role to check. |
|
| The function signature to check. |
Returns
Name | Type | Description |
---|---|---|
|
| Whether the role can call the function. |