Table of Contents

Class Permission

Namespace
Oqtane.Models
Assembly
Oqtane.Shared.dll

Permission information for anything in Oqtane. Things in Oqtane are identified as Entities, so anything that can be identified can be described here.

public class Permission : ModelBase, IAuditable
Inheritance
Permission
Implements
Inherited Members

Constructors

Permission()

public Permission()

Permission(int, string, int, string, string, int?, bool)

public Permission(int siteId, string entityName, int entityId, string permissionName, string roleName, int? userId, bool isAuthorized)

Parameters

siteId int
entityName string
entityId int
permissionName string
roleName string
userId int?
isAuthorized bool

Permission(int, string, string, string, int?, bool)

public Permission(int siteId, string entityName, string permissionName, string roleName, int? userId, bool isAuthorized)

Parameters

siteId int
entityName string
permissionName string
roleName string
userId int?
isAuthorized bool

Permission(string, int, bool)

public Permission(string permissionName, int userId, bool isAuthorized)

Parameters

permissionName string
userId int
isAuthorized bool

Permission(string, string, bool)

public Permission(string permissionName, string roleName, bool isAuthorized)

Parameters

permissionName string
roleName string
isAuthorized bool

Properties

EntityId

ID of the Entity these permissions apply to (ie. a ModuleId). A value of -1 indicates the permission applies to all EntityNames regardless of ID (ie. API permissions)

public int EntityId { get; set; }

Property Value

int

EntityName

Name of the Entity these permissions apply to (ie. Module )

public string EntityName { get; set; }

Property Value

string

IsAuthorized

The type of permission (ie. grant = true, deny = false)

public bool IsAuthorized { get; set; }

Property Value

bool

PermissionId

Internal ID storing this information.

public int PermissionId { get; set; }

Property Value

int

PermissionName

Name of the permission (ie. View)

public string PermissionName { get; set; }

Property Value

string

Role

[Obsolete("The Role property is deprecated", false)]
[NotMapped]
[JsonIgnore]
public Role Role { get; set; }

Property Value

Role

RoleId

Role this permission applies to. If null then this is a User permission.

public int? RoleId { get; set; }

Property Value

int?

RoleName

The role name associated to the RoleId.

[NotMapped]
public string RoleName { get; set; }

Property Value

string

SiteId

Reference to the Site which contains both the target Entity and permissions.

public int SiteId { get; set; }

Property Value

int

UserId

User this permission applies to. If null then this is a Role permission.

public int? UserId { get; set; }

Property Value

int?

Methods

Clone()

public Permission Clone()

Returns

Permission