group admin methods for essential management

This commit is contained in:
2458773093
2019-07-29 22:45:29 +03:00
parent 06bda6e9e6
commit 43210360e9
7 changed files with 138 additions and 4 deletions

View File

@@ -1,14 +1,26 @@
# frozen_string_literal: true
class GroupPolicy < ApplicationPolicy
def index?
true
end
def update?
check_archive!
is_group_admin?
if admin?
true
else
check_archive!
is_group_admin?
end
end
def destroy?
check_archive!
is_group_admin?
if admin?
true
else
check_archive!
is_group_admin?
end
end
def approve_status?