-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creations: hide/delete, view admin info
- Loading branch information
1 parent
96b1cad
commit 39ce607
Showing
2 changed files
with
133 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
class UserCreationPolicy < ApplicationPolicy | ||
FULL_ACCESS_ROLES = %w[superadmin legal policy_and_abuse].freeze | ||
|
||
def show_admin_options? | ||
destroy? || hide? || edit? | ||
end | ||
|
||
def destroy? | ||
user_has_roles?(%w[superadmin policy_and_abuse]) | ||
user_has_roles?(FULL_ACCESS_ROLES) | ||
end | ||
|
||
def hide? | ||
user_has_roles?(%w[superadmin policy_and_abuse]) | ||
user_has_roles?(FULL_ACCESS_ROLES) | ||
end | ||
|
||
def show_ip_address? | ||
user_has_roles?(%w[superadmin legal policy_and_abuse]) | ||
user_has_roles?(FULL_ACCESS_ROLES) | ||
end | ||
|
||
def show_original_creators? | ||
user_has_roles?(%w[superadmin policy_and_abuse]) | ||
user_has_roles?(FULL_ACCESS_ROLES) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters