/// <summary> /// 构造函数 /// </summary> /// <param name="id">权限数值</param> public AuthorizationFilter(int id) { string description = ""; string key = ConvertToEnumName(id,out description); var per = new PermissionsPoint(id.ToString(), key, description); CurrentPermissionsPoint = per; _permissionsProvider.SetCurrentPermissions(UserIdentityFactory.Instance.UserIdentity, per); _permissionsProvider = UserIdentityCollection.Instance; }
/// <summary> /// Initializes a new instance of the <see cref="RoleController"/> class. /// </summary> /// <param name="requestDispatcherFactory">The request dispatcher factory.</param> /// <param name="permissionProvider">The permission provider.</param> public RoleController(IRequestDispatcherFactory requestDispatcherFactory, IProvidePermissions permissionProvider) : base(requestDispatcherFactory) { _permissionProvider = permissionProvider; }
/// <summary> /// 构造函数 /// </summary> /// <param name="providePermissions">存储和获取权限的提供者</param> public UserIdentityAuthorization(IProvidePermissions providePermissions) { _PermissionsProvider = providePermissions; }
public GetAvailablePermissionsRequestHandler(IRoleRepository roleRepository, IProvidePermissions permissionsProvider) { _roleRepository = roleRepository; _permissionsProvider = permissionsProvider; }
/// <summary> /// 构造函数 /// </summary> /// <param name="currentPermissionsPoint">当前权限点实体</param> public AuthorizationFilter(PermissionsPoint currentPermissionsPoint) { CurrentPermissionsPoint = currentPermissionsPoint; _permissionsProvider.SetCurrentPermissions(UserIdentityFactory.Instance.UserIdentity, currentPermissionsPoint); _permissionsProvider = UserIdentityCollection.Instance; }
/// <summary> /// 构造函数 /// </summary> /// <param name="currentPermissionsPoint">当前权限点实体</param> /// <param name="permissionsProvider">存储和获取权限的提供者</param> public AuthorizationFilter(PermissionsPoint currentPermissionsPoint, IProvidePermissions permissionsProvider) { CurrentPermissionsPoint = currentPermissionsPoint; _permissionsProvider = permissionsProvider; }