The default implementation of the Korzh.EasyQuery.Services.IEqAuthProvider interface. Contains several methods which allow to mark some EasyQuery actions as “anonymous” (so they can be accessed by any user) and to restrict the access to them depening on user role.
Contains the dictionary of action guards. Each EasyQuery action has a function (guard) which return true if this action can be accessed by the current user
Sets anonymous access for the actions specified in the parameter.
FillDefaultActionGuards()
void
Fills the Korzh.EasyQuery.Services.DefaultEqAuthProvider.ActionGuards list with the default guards. The default setup includes the following 2 rules: 1. All actions requires authorization. 2. NewQuery, SaveQuery and RemoveQuery actions requires also the “EasyQuery Manager” (eqmanager) role.
GetAuthorizedGuard()
Func<Task<bool>>
Gets the guard functions which returnc true only if the current user is authenticated.
GetGrantAccessForPolicyGuard(string policy)
Func<Task<bool>>
Gets the guard functions which returnc true only if the current user with specified policy.
GetGrantAccessForRolesGuard(String[] roles)
Func<Task<bool>>
Gets the guard functions which grants access only for users with the specifeid roles.