Skip to content

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.

csharp
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 ​

MethodSummary
EvaluateWorks out what the policies let a caller do to a resource.
ActionOfThe action an operation performs: <c>tables/query</c> reads rows, <c>tables/insert...
ResourceOfWhat 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.

csharp
DmAccessRules Evaluate(
    DmAccessContext context,
    DmResource resource,
    DmAction action)

Parameters ​

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.

csharp
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.

csharp
DmResource ResourceOf(DapperMaticOperation context)

Parameters ​

Returns ​

Type: DmResource

The resource.

GetType ​

csharp
GetType()

ToString ​

csharp
ToString()

Equals ​

csharp
Equals()

GetHashCode ​

csharp
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>