Remove sub directories

This commit is contained in:
2020-05-12 10:07:01 +02:00
parent 678a2f48d2
commit 4504600268
77 changed files with 1 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package fr.dcproject.security.voter
import fr.dcproject.entity.OpinionChoice
import fr.ktorVoter.ActionI
import fr.ktorVoter.Vote
import fr.ktorVoter.Voter
import io.ktor.application.ApplicationCall
class OpinionChoiceVoter : Voter {
enum class Action : ActionI {
VIEW
}
override fun supports(action: ActionI, call: ApplicationCall, subject: Any?): Boolean {
return (action is Action)
.and(subject is OpinionChoice?)
}
override fun vote(action: ActionI, call: ApplicationCall, subject: Any?): Vote {
if (action == Action.VIEW) {
if (subject is OpinionChoice) {
return Vote.GRANTED
}
return Vote.DENIED
}
return Vote.ABSTAIN
}
}