Skip to content

LocalTextPermissionModel class

namespace: Serenity.Web   assembly: Serenity.Net.Web

Which permissions local text keys require, as determined once by LocalTextPermissionFilter. Permissions are referred to by their index in Permissions, so that the access of a user can be represented as a boolean per permission.

public class LocalTextPermissionModel
parameter description
permissions Distinct permissions referred to by gates, grants and restrictions
gates Key prefixes (ending with a dot) and the permissions any of which allows the keys starting with them
grants Exact keys and the permissions any of which allows them, regardless of restrictions and gates, e.g. the texts used by forms and columns
restrictions Exact keys and the permissions any of which allows them, which decides for the key instead of the gates, e.g. the texts of a nested local texts class with a permission
alwaysInclude Key prefixes that are always allowed

Public Members

name description
LocalTextPermissionModel(…) Which permissions local text keys require, as determined once by LocalTextPermissionFilter. Permissions are referred to by their index in Permissions, so that the access of a user can be represented as a boolean per permission.
AlwaysInclude { get; } Key prefixes that are always allowed
Gates { get; } Key prefixes and the permissions any of which allows the keys starting with them
Grants { get; } Exact keys and the permissions any of which allows them, regardless of restrictions and gates
Permissions { get; } Distinct permissions referred to by gates, grants and restrictions
Restrictions { get; } Exact keys and the permissions any of which allows them, deciding instead of the gates
IsAllowed(…) Returns true if a user with the granted permissions may see the key. A key is allowed when it starts with an always included prefix, or when it has a grant the user has. Otherwise its restriction decides if it has one, or else the longest gate prefix it starts with, and it is allowed when neither exists.

See Also