PermissionSettingHelper.AddObjectPermission<T>(IPermissionPolicyRole, String, String, Nullable<SecurityPermissionState>) Method
Finds the first type permission for the specified type in the role and adds the object permission to it. If the appropriate type permission is not found, this method creates it.
Namespace: DevExpress.ExpressApp.Security
Assembly: DevExpress.ExpressApp.Security.v24.2.dll
NuGet Package: DevExpress.ExpressApp.Security
#Declaration
public static IPermissionPolicyObjectPermissionsObject AddObjectPermission<T>(
this IPermissionPolicyRole role,
string operations,
string criteria,
SecurityPermissionState? state
)
where T : class
#Parameters
Name | Type | Description |
---|---|---|
role | IPermission |
The target role for a new object permission. |
operations | String | The semicolon-separated list of security operations. The static Security |
criteria | String | The criteria expression that specifies the target object |
state | Nullable<Security |
A Security |
#Type Parameters
Name | Description |
---|---|
T | This method finds the type permission for this type in the role. |
#Returns
Type | Description |
---|---|
DevExpress. |
The added object permission. |
#Remarks
Alternatively, you can use the AddObjectPermissionFromLambda<T>(IPermissionPolicyRole, String, Expression<Func<T, Boolean>>, Nullable<SecurityPermissionState>) method, which takes a lambda expression instead of a criteria expression.