diff --git a/app/models/user.rb b/app/models/user.rb index ce2890e..d9bae98 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -237,6 +237,15 @@ roles.include? Role.find_by(name: constant('user_role_types.grant_api_to_orgs')) end + + ## + # checks if the user can grant the api to organisations + # + # @return [Boolean] true if the user can grant api permissions to organisations + def can_grant_api_to_orgs? + roles.include? Role.find_by(name: constant('user_role_types.grant_api_to_orgs')) + end + ## # checks what type the user's organisation is # diff --git a/app/views/users/admin_index.html.erb b/app/views/users/admin_index.html.erb index 9bf9300..4bea24a 100644 --- a/app/views/users/admin_index.html.erb +++ b/app/views/users/admin_index.html.erb @@ -15,7 +15,6 @@