C# Класс Serenity.Authorization

Provides a common access point for authorization related services
Показать файл Открыть проект

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

Метод Описание
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.

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

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

Returns true if current user has given permission.
public static HasPermission ( string permission ) : bool
permission string Permission key (e.g. Administration)
Результат bool

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

Checks if there is a currently logged user and throws a validation error with "NotLoggedIn" error code if not.
public static ValidateLoggedIn ( ) : void
Результат void

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

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
Результат void