AccessSettings.TrySetRules(IAccessRule[]) Method
Sets resource access rules.
Namespace: DevExpress.Security.Resources
Assembly: DevExpress.Data.v19.2.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
rules | IAccessRule[] | An array of access rules. |
Returns
Type | Description |
---|---|
Boolean | true, if the specified rule collection is registered successfully. Otherwise, false. |
Remarks
Before you set access rules, specify the resources for which these rules should be checked. To do this, use one of the following static properties:
The TrySetRules(IAccessRules[]) method can be called only once during the application run. This allows rules not to be overridden. So, call this method when the application starts to specify rules before a control (for example, Web End-User ReportDesigner) sets its rules. Otherwise, the TrySetRules(IAccessRules[]) method does not register the specified rule collection and returns false.
You can use the SetRules(IAccessRule[]) method to set access rules. This method raises an exception if a control sets its rules earlier.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TrySetRules(IAccessRule[]) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.