Back to Devexpress

PermissionSettingHelper.AddObjectPermission<T>(IPermissionPolicyRole, String, String, Nullable<SecurityPermissionState>) Method

expressappframework-devexpress-dot-expressapp-dot-security-dot-permissionsettinghelper-dot-addobjectpermission-t-x28-ipermissionpolicyrole-string-string-nullable-securitypermissionstate-x29.md

latest3.8 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.ExpressApp.Security

Declaration

csharp
public static IPermissionPolicyObjectPermissionsObject AddObjectPermission<T>(
    this IPermissionPolicyRole role,
    string operations,
    string criteria,
    SecurityPermissionState? state
)
    where T : class
vb
<ExtensionAttribute>
Public Shared Function AddObjectPermission(Of T As Class)(
    role As IPermissionPolicyRole,
    operations As String,
    criteria As String,
    state As SecurityPermissionState?
) As IPermissionPolicyObjectPermissionsObject

Parameters

NameTypeDescription
roleIPermissionPolicyRole

The target role for a new object permission.

| | operations | String |

The semicolon-separated list of security operations. The static SecurityOperations class defines operation names and their delimiter.

| | criteria | String |

The criteria expression that specifies the target object(s).

| | state | Nullable<SecurityPermissionState> |

A SecurityPermissionState enumeration value that specifies if access is granted or denied.

|

Type Parameters

NameDescription
T

This method finds the type permission for this type in the role.

|

Returns

TypeDescription
DevExpress.Persistent.Base.IPermissionPolicyObjectPermissionsObject

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.

See Also

PermissionSettingHelper Class

PermissionSettingHelper Members

DevExpress.ExpressApp.Security Namespace