C# Class Hero.Configuration.HeroConfig

显示文件 Open project: Skookum/Hero

Public Methods

Method Description
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

Method Details

Can() public static method

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
return bool

Cannot() public static method

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
return bool

Initialize() public static method

public static Initialize ( IAbilityAuthorizationService authorizationService ) : void
authorizationService IAbilityAuthorizationService
return void

RegisterAbilities() public static method

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
return void

RegisterAbility() public static method

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
return void

RegisterRole() public static method

Assign a set of roles to a user
public static RegisterRole ( IUser user, IRole role ) : void
user IUser
role IRole
return void

RegisterRoles() public static method

Assign a set of roles to a user
public static RegisterRoles ( IUser user, IEnumerable roles ) : void
user IUser
roles IEnumerable
return void

UnregisterAbilities() public static method

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
return void

UnregisterAbility() public static method

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
return void

UnregisterRole() public static method

Unassign a set of roles to a user
public static UnregisterRole ( IUser user, IRole role ) : void
user IUser
role IRole
return void

UnregisterRoles() public static method

Unassign a set of roles to a user
public static UnregisterRoles ( IUser user, IEnumerable roles ) : void
user IUser
roles IEnumerable
return void