Class PermissionDefinition
Inheritance
System.Object
PermissionDefinition
Assembly: Volo.Abp.Authorization.dll
Syntax
public class PermissionDefinition : object
Constructors
PermissionDefinition(String, ILocalizableString, MultiTenancySides, Boolean)
Declaration
protected PermissionDefinition(string name, ILocalizableString displayName = null, MultiTenancySides multiTenancySide = default(MultiTenancySides), bool isEnabled = true)
Parameters
Properties
Children
Declaration
public IReadOnlyList<PermissionDefinition> Children { get; }
Property Value
DisplayName
Declaration
public ILocalizableString DisplayName { get; set; }
Property Value
IsEnabled
Indicates whether this permission is enabled or disabled.
A permission is normally enabled.
A disabled permission can not be granted to anyone, but it is still
will be available to check its value (while it will always be false).
Disabling a permission would be helpful to hide a related application
functionality from users/clients.
Default: true.
Declaration
public bool IsEnabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Item[String]
Declaration
public object this[string name] { get; set; }
Parameters
Type |
Name |
Description |
System.String |
name |
Name of the property
|
Property Value
Type |
Description |
System.Object |
Returns the value in the Properties dictionary by given .
Returns null if given is not present in the Properties dictionary.
|
MultiTenancySide
MultiTenancy side.
Default: Both
Declaration
public MultiTenancySides MultiTenancySide { get; set; }
Property Value
Name
Unique name of the permission.
Declaration
public string Name { get; }
Property Value
Type |
Description |
System.String |
|
Parent
Parent of this permission if one exists.
If set, this permission can be granted only if parent is granted.
Declaration
public PermissionDefinition Parent { get; }
Property Value
Properties
Can be used to get/set custom properties for this permission definition.
Declaration
public Dictionary<string, object> Properties { get; }
Property Value
Type |
Description |
Dictionary<System.String, System.Object> |
|
Providers
A list of allowed providers to get/set value of this permission.
An empty list indicates that all providers are allowed.
Declaration
public List<string> Providers { get; }
Property Value
Type |
Description |
List<System.String> |
|
Methods
AddChild(String, ILocalizableString, MultiTenancySides, Boolean)
Declaration
public virtual PermissionDefinition AddChild(string name, ILocalizableString displayName = null, MultiTenancySides multiTenancySide = default(MultiTenancySides), bool isEnabled = true)
Parameters
Returns
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
WithProperty(String, Object)
Sets a property in the Properties dictionary.
This is a shortcut for nested calls on this object.
Declaration
public virtual PermissionDefinition WithProperty(string key, object value)
Parameters
Type |
Name |
Description |
System.String |
key |
|
System.Object |
value |
|
Returns
WithProviders(String[])
Sets a property in the Properties dictionary.
This is a shortcut for nested calls on this object.
Declaration
public virtual PermissionDefinition WithProviders(params string[] providers)
Parameters
Type |
Name |
Description |
System.String[] |
providers |
|
Returns
Extension Methods