Table of Contents

Class UserPermissions

Namespace
Oqtane.Security
Assembly
Oqtane.Server.dll
public class UserPermissions : IUserPermissions
Inheritance
UserPermissions
Implements

Constructors

UserPermissions(IPermissionRepository, IUserRoleRepository, IHttpContextAccessor)

public UserPermissions(IPermissionRepository permissions, IUserRoleRepository userRoles, IHttpContextAccessor accessor)

Parameters

permissions IPermissionRepository
userRoles IUserRoleRepository
accessor IHttpContextAccessor

Methods

GetUser()

public User GetUser()

Returns

User

GetUser(ClaimsPrincipal)

public User GetUser(ClaimsPrincipal principal)

Parameters

principal ClaimsPrincipal

Returns

User

IsAuthorized(ClaimsPrincipal, int, string, int, string)

public bool IsAuthorized(ClaimsPrincipal principal, int siteId, string entityName, int entityId, string permissionName)

Parameters

principal ClaimsPrincipal
siteId int
entityName string
entityId int
permissionName string

Returns

bool

IsAuthorized(ClaimsPrincipal, int, string, int, string, string)

public bool IsAuthorized(ClaimsPrincipal principal, int siteId, string entityName, int entityId, string permissionName, string roles)

Parameters

principal ClaimsPrincipal
siteId int
entityName string
entityId int
permissionName string
roles string

Returns

bool

IsAuthorized(ClaimsPrincipal, string, List<Permission>)

public bool IsAuthorized(ClaimsPrincipal principal, string permissionName, List<Permission> permissionList)

Parameters

principal ClaimsPrincipal
permissionName string
permissionList List<Permission>

Returns

bool

IsAuthorized(ClaimsPrincipal, string, int, string)

public bool IsAuthorized(ClaimsPrincipal principal, string entityName, int entityId, string permissionName)

Parameters

principal ClaimsPrincipal
entityName string
entityId int
permissionName string

Returns

bool

IsAuthorized(ClaimsPrincipal, string, string)

[Obsolete("IsAuthorized(ClaimsPrincipal principal, string permissionName, string permissions) is deprecated. Use IsAuthorized(ClaimsPrincipal principal, string permissionName, List<Permission> permissionList) instead", false)]
public bool IsAuthorized(ClaimsPrincipal principal, string permissionName, string permissions)

Parameters

principal ClaimsPrincipal
permissionName string
permissions string

Returns

bool