Lint project

This commit is contained in:
2019-10-10 22:50:24 +02:00
parent 194620e15b
commit f76f6f83bb
36 changed files with 81 additions and 118 deletions

View File

@@ -3,8 +3,8 @@ package fr.dcproject.security.voter
import fr.dcproject.entity.Comment
import io.ktor.application.ApplicationCall
class CommentVoter: Voter {
enum class Action: ActionI {
class CommentVoter : Voter {
enum class Action : ActionI {
CREATE,
UPDATE,
VIEW,
@@ -12,8 +12,8 @@ class CommentVoter: Voter {
}
override fun supports(action: ActionI, call: ApplicationCall, subject: Any?): Boolean {
return (action is Action) &&
(subject is Comment<*>? || subject is List<*>)
return (action is Action)
.and(subject is Comment<*>? || subject is List<*>)
}
override fun vote(action: ActionI, call: ApplicationCall, subject: Any?): Vote {