Show / Hide Table of Contents

Class PermissionDefinition

Inheritance
System.Object
PermissionDefinition
Namespace: Volo.Abp.Authorization.Permissions
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
Type Name Description
System.String name
ILocalizableString displayName
MultiTenancySides multiTenancySide
System.Boolean isEnabled

Properties

Children

Declaration
public IReadOnlyList<PermissionDefinition> Children { get; }
Property Value
Type Description
IReadOnlyList<PermissionDefinition>

DisplayName

Declaration
public ILocalizableString DisplayName { get; set; }
Property Value
Type Description
ILocalizableString

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]

Gets/sets a key-value on the Properties.

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
Type Description
MultiTenancySides

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
Type Description
PermissionDefinition

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
Type Name Description
System.String name
ILocalizableString displayName
MultiTenancySides multiTenancySide
System.Boolean isEnabled
Returns
Type Description
PermissionDefinition

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
Type Description
PermissionDefinition

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
Type Description
PermissionDefinition

Extension Methods

AbpObjectExtensions.As<T>(Object)
AbpObjectExtensions.To<T>(Object)
AbpObjectExtensions.IsIn<T>(T, T[])
AbpObjectExtensions.If<T>(T, Boolean, Func<T, T>)
AbpObjectExtensions.If<T>(T, Boolean, Action<T>)
LockExtensions.Locking(Object, Action)
LockExtensions.Locking<T>(T, Action<T>)
LockExtensions.Locking<TResult>(Object, Func<TResult>)
LockExtensions.Locking<T, TResult>(T, Func<T, TResult>)
Back to top Powered by Volosoft