C# Class Serenity.Authorization

Provides a common access point for authorization related services
Exibir arquivo Open project: volkanceylan/Serenity

Public Methods

Method Description
HasPermission ( string permission ) : bool

Returns true if current user has given permission.

ValidateLoggedIn ( ) : void

Checks if there is a currently logged user and throws a validation error with "NotLoggedIn" error code if not.

ValidatePermission ( string permission ) : void

Checks if current user has given permission and throws a validation error with "AccessDenied" error code if not.

Method Details

HasPermission() public static method

Returns true if current user has given permission.
public static HasPermission ( string permission ) : bool
permission string Permission key (e.g. Administration)
return bool

ValidateLoggedIn() public static method

Checks if there is a currently logged user and throws a validation error with "NotLoggedIn" error code if not.
public static ValidateLoggedIn ( ) : void
return void

ValidatePermission() public static method

Checks if current user has given permission and throws a validation error with "AccessDenied" error code if not.
public static ValidatePermission ( string permission ) : void
permission string
return void