register<TUser, TResource> method

void register<TUser, TResource>(
  1. String action,
  2. DVPolicyCheck<TUser, TResource> check
)

Registers the application's own answer for action on TResource.

It replaces an earlier one of the application's, and wins over one registered from a @DVPolicy class whichever of the two ran first -- an answer written in code is the one somebody chose for this process, and which one a request gets must not depend on startup order.

Implementation

void register<TUser, TResource>(
  String action,
  DVPolicyCheck<TUser, TResource> check,
) {
  _policies[_keyOf<TResource>(action)] =
      _DVPolicyEntry.of<TUser, TResource>(check);
}