Interface IPermissionRegistry
The service used for registering and looking up permissions.
Namespace: OpenMod.API.Permissions
Assembly: OpenMod.API.dll
Syntax
public interface IPermissionRegistry
Methods
| Improve this Doc View SourceFindPermission(IOpenModComponent, String)
Searches for a permission registration.
Declaration
IPermissionRegistration FindPermission(IOpenModComponent component, string permission)
Parameters
Type | Name | Description |
---|---|---|
IOpenModComponent | component | The component that has registered the permission. |
System.String | permission | The permission to search for. |
Returns
Type | Description |
---|---|
IPermissionRegistration | The registered permission if founds; otherwise, null. |
FindPermission(String)
Searches for a permission registration.
Declaration
IPermissionRegistration FindPermission(string permission)
Parameters
Type | Name | Description |
---|---|---|
System.String | permission | The permission to search for. |
Returns
Type | Description |
---|---|
IPermissionRegistration | The registered permission if founds; otherwise, null. |
GetPermissions(IOpenModComponent)
Gets the registered permissions for the given component.
Declaration
IReadOnlyCollection<IPermissionRegistration> GetPermissions(IOpenModComponent component)
Parameters
Type | Name | Description |
---|---|---|
IOpenModComponent | component | The component to get the permissions of. |
Returns
Type | Description |
---|---|
IReadOnlyCollection<IPermissionRegistration> | The registered permissions of the given component. |
RegisterPermission(IOpenModComponent, String, Nullable<String>, Nullable<PermissionGrantResult>)
Registers a permission.
Declaration
void RegisterPermission(IOpenModComponent component, string permission, string? description = null, PermissionGrantResult? defaultGrant = null)
Parameters
Type | Name | Description |
---|---|---|
IOpenModComponent | component | The component registering the permission. |
System.String | permission | The permission. |
System.Nullable<System.String> | description | The optional description. |
System.Nullable<PermissionGrantResult> | defaultGrant | The optional default grant. Will default to Default. See DefaultGrant. |