klint
This commit is contained in:
@@ -27,8 +27,8 @@ class WorkgroupVoter : Voter<ApplicationCall> {
|
||||
|
||||
override fun invoke(action: Any, context: ApplicationCall, subject: Any?): VoterResponseI {
|
||||
if ((action is Action && subject == null)) throw NoSubjectDefinedException(action)
|
||||
if (!((action is Action || action is ActionMembers)
|
||||
&& (subject is WorkgroupI? || (subject is List<*> && subject.first() is WorkgroupI)))) return abstain()
|
||||
if (!((action is Action || action is ActionMembers) &&
|
||||
(subject is WorkgroupI? || (subject is List<*> && subject.first() is WorkgroupI)))) return abstain()
|
||||
|
||||
val user = context.user
|
||||
if (action == Action.CREATE) {
|
||||
@@ -38,7 +38,6 @@ class WorkgroupVoter : Voter<ApplicationCall> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (action == Action.VIEW) {
|
||||
if (subject is WorkgroupWithAuthI<*>) {
|
||||
return if (subject.isDeleted()) denied("You cannot view a deleted workgroup", "workgroup.view.deleted")
|
||||
|
||||
Reference in New Issue
Block a user