C# Класс Hero.Configuration.HeroConfig

Показать файл Открыть проект

Открытые методы

Метод Описание
Can ( string userName, string ability ) : bool

Verify a user can perform the given ability. Primarily intended as syntatic sugar.

Cannot ( string userName, string ability ) : bool

Verify a user cannot perform the given ability. Primarily intended as syntatic sugar.

Initialize ( IAbilityAuthorizationService authorizationService ) : void
RegisterAbilities ( IRole role, IEnumerable abilities ) : void

Assign a set of abilities to a role.

RegisterAbility ( IRole role, IAbility ability ) : void

Assign a set of abilities to a role.

RegisterRole ( IUser user, IRole role ) : void

Assign a set of roles to a user

RegisterRoles ( IUser user, IEnumerable roles ) : void

Assign a set of roles to a user

UnregisterAbilities ( IRole role, IEnumerable abilities ) : void

Unassign a set of abilities to a role.

UnregisterAbility ( IRole role, IAbility ability ) : void

Unassign a set of abilities to a role.

UnregisterRole ( IUser user, IRole role ) : void

Unassign a set of roles to a user

UnregisterRoles ( IUser user, IEnumerable roles ) : void

Unassign a set of roles to a user

Описание методов

Can() публичный статический Метод

Verify a user can perform the given ability. Primarily intended as syntatic sugar.
public static Can ( string userName, string ability ) : bool
userName string
ability string
Результат bool

Cannot() публичный статический Метод

Verify a user cannot perform the given ability. Primarily intended as syntatic sugar.
public static Cannot ( string userName, string ability ) : bool
userName string
ability string
Результат bool

Initialize() публичный статический Метод

public static Initialize ( IAbilityAuthorizationService authorizationService ) : void
authorizationService IAbilityAuthorizationService
Результат void

RegisterAbilities() публичный статический Метод

Assign a set of abilities to a role.
public static RegisterAbilities ( IRole role, IEnumerable abilities ) : void
role IRole The role that is to be inspected and if nescessary configured
abilities IEnumerable The abilities to assign the role if nescessary
Результат void

RegisterAbility() публичный статический Метод

Assign a set of abilities to a role.
public static RegisterAbility ( IRole role, IAbility ability ) : void
role IRole The role that is to be inspected and if nescessary configured
ability IAbility The ability to assign the role if nescessary
Результат void

RegisterRole() публичный статический Метод

Assign a set of roles to a user
public static RegisterRole ( IUser user, IRole role ) : void
user IUser
role IRole
Результат void

RegisterRoles() публичный статический Метод

Assign a set of roles to a user
public static RegisterRoles ( IUser user, IEnumerable roles ) : void
user IUser
roles IEnumerable
Результат void

UnregisterAbilities() публичный статический Метод

Unassign a set of abilities to a role.
public static UnregisterAbilities ( IRole role, IEnumerable abilities ) : void
role IRole The role that is to be inspected and if nescessary configured
abilities IEnumerable The abilities to assign the role if nescessary
Результат void

UnregisterAbility() публичный статический Метод

Unassign a set of abilities to a role.
public static UnregisterAbility ( IRole role, IAbility ability ) : void
role IRole The role that is to be inspected and if nescessary configured
ability IAbility The abilities to assign the role if nescessary
Результат void

UnregisterRole() публичный статический Метод

Unassign a set of roles to a user
public static UnregisterRole ( IUser user, IRole role ) : void
user IUser
role IRole
Результат void

UnregisterRoles() публичный статический Метод

Unassign a set of roles to a user
public static UnregisterRoles ( IUser user, IEnumerable roles ) : void
user IUser
roles IEnumerable
Результат void