SapphireDb logo SapphireDb

Remove - Authentication/Authorization

You can use the [RemoveAuth]-Attribute to control the permission of a user to remove data from the collection.

Usage

The [RemoveAuth]-Attribute can be used on the model class

Every auth-attribute can be used in three ways.
  1. Without attributes: Authentication required
  2. Policies: A comma separated string of policy-names. All policies have to succeed. Check out Policies for more details
  3. Function name: You can optionally pass the name of a function in the class that has to return a boolean. The function will get executed to check if the user is allowed for the action.
Multiple attributes: You can define multiple Attributes for each model. Only one of the attributes defined condition has to succeed.
Heredity: If you define AuthAttributes for a base class all sub classes will inherit this attributes until custom attributes of the same type are defined in the subclasses.

The usage equals the usage of the [QueryAuth]-Attribute. Check out the Documentation for Query

This website uses Google Analytics. If you want to disable it just unselect the option: