C# Class Rock.Security.Role

Show file Open project: NewSpring/Rock Class Usage Examples

Public Methods

Method Description
AllRoles ( ) : List

Returns a list of all the possible Roles

Flush ( int id ) : void

Removes role from cache

GetOrAddExisting ( string key, Func valueFactory ) : Role

Gets the or add existing.

IsPersonInRole ( System.Guid personGuid ) : bool

Is user in role

LoadById ( int id ) : Role

Loads the by identifier.

Read ( int id ) : Role

Returns Role object from cache. If role does not already exist in cache, it will be read and added to cache

Private Methods

Method Description
CacheKey ( int id ) : string

Caches the key.

Role ( ) : System

Use Static Read() method to instantiate a new Role object

Method Details

AllRoles() public static method

Returns a list of all the possible Roles
public static AllRoles ( ) : List
return List

Flush() public static method

Removes role from cache
public static Flush ( int id ) : void
id int The id.
return void

GetOrAddExisting() public static method

Gets the or add existing.
public static GetOrAddExisting ( string key, Func valueFactory ) : Role
key string The key.
valueFactory Func The value factory.
return Role

IsPersonInRole() public method

Is user in role
public IsPersonInRole ( System.Guid personGuid ) : bool
personGuid System.Guid The person unique identifier.
return bool

LoadById() public static method

Loads the by identifier.
public static LoadById ( int id ) : Role
id int The identifier.
return Role

Read() public static method

Returns Role object from cache. If role does not already exist in cache, it will be read and added to cache
public static Read ( int id ) : Role
id int The id.
return Role