Interface IPermissionStore
Provider for storing permissions.
Namespace: OpenMod.API.Permissions
Assembly: OpenMod.API.dll
Syntax
public interface IPermissionStore
Methods
| Improve this Doc View SourceAddDeniedPermissionAsync(IPermissionActor, String)
Adds an explicitly denied permission to the actor.
Declaration
Task<bool> AddDeniedPermissionAsync(IPermissionActor actor, string permission)
Parameters
Type | Name | Description |
---|---|---|
IPermissionActor | actor | The actor. |
System.String | permission | The denied permission to add. |
Returns
Type | Description |
---|---|
Task<System.Boolean> | true if the permission was successfully added or exists already; otherwise, false. |
AddGrantedPermissionAsync(IPermissionActor, String)
Adds an explicitly granted permission to the actor.
Declaration
Task<bool> AddGrantedPermissionAsync(IPermissionActor actor, string permission)
Parameters
Type | Name | Description |
---|---|---|
IPermissionActor | actor | The actor. |
System.String | permission | The permission to add. |
Returns
Type | Description |
---|---|
Task<System.Boolean> | true if the permission was successfully added or exists already; otherwise, false. |
GetDeniedPermissionsAsync(IPermissionActor, Boolean)
Gets the denied permissions of the given actor.
Declaration
Task<IReadOnlyCollection<string>> GetDeniedPermissionsAsync(IPermissionActor actor, bool inherit = true)
Parameters
Type | Name | Description |
---|---|---|
IPermissionActor | actor | The actor to get denied permissions from. |
System.Boolean | inherit | Defines if the parent roles denied permissions should be included. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<System.String>> | A list of all denied permissions of the actor. |
GetGrantedPermissionsAsync(IPermissionActor, Boolean)
Gets the permissions of the given actor.
Declaration
Task<IReadOnlyCollection<string>> GetGrantedPermissionsAsync(IPermissionActor actor, bool inherit = true)
Parameters
Type | Name | Description |
---|---|---|
IPermissionActor | actor | The actor to get permissions from. |
System.Boolean | inherit | Defines if the parent roles permissions should be included. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<System.String>> | A list of all permissions of the actor. |
RemoveDeniedPermissionAsync(IPermissionActor, String)
Removes an explicitly denied permission from the actor.
Declaration
Task<bool> RemoveDeniedPermissionAsync(IPermissionActor actor, string permission)
Parameters
Type | Name | Description |
---|---|---|
IPermissionActor | actor | The actor. |
System.String | permission | The permission to remove. |
Returns
Type | Description |
---|---|
Task<System.Boolean> | true if the permission was successfully removed or doesn't exist; otherwise, false. |
RemoveGrantedPermissionAsync(IPermissionActor, String)
Removes an explicitly granted permission from the actor.
Declaration
Task<bool> RemoveGrantedPermissionAsync(IPermissionActor actor, string permission)
Parameters
Type | Name | Description |
---|---|---|
IPermissionActor | actor | The actor. |
System.String | permission | The permission to remove. |
Returns
Type | Description |
---|---|
Task<System.Boolean> | true if the permission was successfully removed or doesn't exist; otherwise, false. |