add citizen in ApplicationCall

This commit is contained in:
2019-08-26 17:13:47 +02:00
parent adba5a5aad
commit bfcbfee120
3 changed files with 32 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ fun ApplicationCall.can(action: ActionI, subject: Any? = null): Boolean {
abstract class VoterException(message: String) : Throwable(message)
class NoVoterException(action: ActionI) : VoterException("No voter found for action '$action'")
class UnauthorizedException(action: ActionI) : VoterException("Unauthorized for action '$action'")
class ForbiddenException : Throwable()
class ForbiddenException(message: String? = null) : Throwable(message)
val ApplicationCall.user get() = authentication.principal<User>()