DapperMaticPolicySet
Namespace: MJCZone.DapperMatic.AspNetCore.Security
Assembly: MJCZone.DapperMatic.AspNetCore
Summary
The policies in force: those of Policies, given in code or configuration, with RequireRole and ReadOnlyRole as policies of their own. Every policy is validated when the set is built, at startup.
sealed public
Contents
Constructors (1) | Methods (7) | Properties (2)
Constructors
DapperMaticPolicySet
Initializes a new instance of the DapperMaticPolicySet class.
DapperMaticPolicySet(
DapperMaticOptions} options,
DapperMaticStoredAccess stored)Parameters
- options (DapperMaticOptions}) - The options holding the policies.
- stored (DapperMaticStoredAccess) - The policies kept by DapperMatic, edited through its access endpoints; null for none.
Methods
| Method | Summary |
|---|---|
| Evaluate | Works out what the policies let a caller do to a resource. |
| ActionOf | The action an operation performs: <c>tables/query</c> reads rows, <c>tables/insert... |
| ResourceOf | What an operation acts on: a listing of datasources or schemas is about every one of them, and is na... |
| GetType | |
| ToString | |
| Equals | |
| GetHashCode |
Evaluate
Works out what the policies let a caller do to a resource.
DmAccessRules Evaluate(
DmAccessContext context,
DmResource resource,
DmAction action)Parameters
- context (DmAccessContext) - The caller, and the request's tenant and values.
- resource (DmResource) - What the request acts on.
- action (DmAction) - The action.
Returns
Type: DmAccessRules
The rules.
ActionOf
The action an operation performs: <c>tables/query</c> reads rows, <c>tables/insert-rows</c> creates them, <c>tables/get</c> reads a definition, <c>tables/post</c> changes the schema, <c>datasources/post</c> manages datasources. An operation DapperMatic does not know, or none (a context the request's endpoint did not fill), is None, which no policy allows.
DmAction? ActionOf(string operation)Parameters
- operation (string) - names it.
Returns
Type: DmAction?
The action.
ResourceOf
What an operation acts on: a listing of datasources or schemas is about every one of them, and is narrowed item by item; any other operation is about the datasource, schema and table or view its route names, the schema being the tenant's when the route names none.
DmResource ResourceOf(DapperMaticOperation context)Parameters
- context (DapperMaticOperation) - The operation.
Returns
Type: DmResource
The resource.
GetType
GetType()ToString
ToString()Equals
Equals()GetHashCode
GetHashCode()Properties
Policies
Gets the policies in force: those of code and configuration, then those kept by DapperMatic.
Type: IReadOnlyList<DmPolicy>
Configured
Gets the policies of code and configuration, which the access endpoints cannot change.
Type: IReadOnlyList<DmPolicy>