Show / Hide Table of Contents

Class MenuPermissionAttribute

An attribute which allows specifying Persona Bar permissions on a Web API controller class or action method.

Inheritance
object
MenuPermissionAttribute
Implements
IOverrideDefaultAuthLevel
Namespace: Dnn.PersonaBar.Library.Attributes
Assembly: Dnn.PersonaBar.Library.dll
Syntax
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public class MenuPermissionAttribute : AuthorizeAttributeBase, IOverrideDefaultAuthLevel

Constructors

MenuPermissionAttribute()

Declaration
public MenuPermissionAttribute()

Properties

Exclude

Gets or sets the Roles which need exclude from permissions, when user in the role will receive 401 exception. If need set multiple roles, put semicolon(;) between role names.

Declaration
public string Exclude { get; set; }
Property Value
Type Description
string

MenuName

Gets or sets the menu identifier which decide the api whether can requested. For example, if this value set to "Pages", the user who have access to pages module can request api. Users who don't have permissions to Pages module, will not available to request the api.

Declaration
public string MenuName { get; set; }
Property Value
Type Description
string

Scope

Gets or sets the default service scope when MenuName is not defined.

Declaration
public ServiceScope Scope { get; set; }
Property Value
Type Description
ServiceScope

Methods

IsAuthorized(AuthFilterContext)

Declaration
public override bool IsAuthorized(AuthFilterContext context)
Parameters
Type Name Description
AuthFilterContext context
Returns
Type Description
bool

Implements

IOverrideDefaultAuthLevel

Extension Methods

JsonExtensionsWeb.ToJson(object)
Back to top by the community, for the community... #DNNCMS