C# Class BeiDream.Core.Security.Authorization.PermissionManagerBase

Inheritance: IPermissionManager
Mostrar archivo Open project: BeiMeng/BeiDream

Public Methods

Method Description
HasPermission ( string resourceUri ) : bool

检查当前用户是否具有该资源的权限

Protected Methods

Method Description
GetApplicationContext ( ) : IApplicationSession

获取应用程序上下文

GetResourceUri ( string resourceUri ) : string

获取资源标识,如果传入的资源标识为空值,由子类重现该方法提供默认值,WEB环境可重写该方法提供当前请求的Url

PermissionManagerBase ( IPermissionSupportService permissionSupportService, bool ignore ) : BeiDream.Utils.Extensions

初始化权限管理器

Private Methods

Method Description
GetName ( ) : string

获取用户编号

Init ( ) : void

初始化组件

ValidateApplication ( ) : bool

验证用户是否属于当前应用程序

ValidateIsAdmin ( ) : bool

验证用户是否属于当前租户

验证是否超级管理员

ValidateRoles ( string resourceUri ) : bool

验证用户角色是否被授权访问该资源

Method Details

GetApplicationContext() protected method

获取应用程序上下文
protected GetApplicationContext ( ) : IApplicationSession
return IApplicationSession

GetResourceUri() protected method

获取资源标识,如果传入的资源标识为空值,由子类重现该方法提供默认值,WEB环境可重写该方法提供当前请求的Url
protected GetResourceUri ( string resourceUri ) : string
resourceUri string 资源标识
return string

HasPermission() public method

检查当前用户是否具有该资源的权限
public HasPermission ( string resourceUri ) : bool
resourceUri string 资源标识
return bool

PermissionManagerBase() protected method

初始化权限管理器
protected PermissionManagerBase ( IPermissionSupportService permissionSupportService, bool ignore ) : BeiDream.Utils.Extensions
permissionSupportService IPermissionSupportService 权限支持服务
ignore bool 是否忽视角色检查
return BeiDream.Utils.Extensions