This commit is contained in:
2021-01-14 22:53:48 +01:00
parent 91ab800272
commit caadc2a969
29 changed files with 50 additions and 56 deletions

View File

@@ -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")