diff --git a/app/models/user.rb b/app/models/user.rb index f0aec25..e7c7432 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -142,7 +142,7 @@ # # @return [Boolean] true if the user can add new organisations def can_add_orgs? - perms.include? Perm.find_by(name: constant("user_role_types.add_organisations")) + perms.include? Perm.find_by(name: constant("roles.add_organisations")) end ## @@ -150,7 +150,7 @@ # # @return [Boolean] true if the user can change their organisation affiliations def can_change_org? - perms.include? Perm.find_by(name: constant("user_role_types.change_org_affiliation")) + perms.include? Perm.find_by(name: constant("roles.change_org_affiliation")) end ## @@ -158,7 +158,7 @@ # # @return [Boolean] true if the user can grant their permissions to others def can_grant_permissions? - perms.include? Perm.find_by(name: constant("user_role_types.grant_permissions")) + perms.include? Perm.find_by(name: constant("roles.grant_permissions")) end ## @@ -166,7 +166,7 @@ # # @return [Boolean] true if the user can modify organisation templates def can_modify_templates? - perms.include? Perm.find_by(name: constant("user_role_types.modify_templates")) + perms.include? Perm.find_by(name: constant("roles.modify_templates")) end ## @@ -174,7 +174,7 @@ # # @return [Boolean] true if the user can modify organistion guidance def can_modify_guidance? - perms.include? Perm.find_by(name: constant("user_role_types.modify_guidance")) + perms.include? Perm.find_by(name: constant("roles.modify_guidance")) end ## @@ -182,7 +182,7 @@ # # @return [Boolean] true if the user can use the api def can_use_api? - perms.include? Perm.find_by(name: constant("user_role_types.use_api")) + perms.include? Perm.find_by(name: constant("roles.use_api")) end ## @@ -190,7 +190,7 @@ # # @return [Boolean] true if the user can modify the org's details def can_modify_org_details? - perms.include? Perm.find_by(name: constant("user_role_types.change_org_details")) + perms.include? Perm.find_by(name: constant("roles.change_org_details")) end ## @@ -198,7 +198,7 @@ # # @return [Boolean] true if the user can grant api permissions to organisations def can_grant_api_to_orgs? - perms.include? Perm.find_by(name: constant('user_role_types.grant_api_to_orgs')) + perms.include? Perm.find_by(name: constant('roles.grant_api_to_orgs')) end @@ -207,7 +207,7 @@ # # @return [Boolean] true if the user can grant api permissions to organisations def can_grant_api_to_orgs? - perms.include? Perm.find_by(name: constant('user_role_types.grant_api_to_orgs')) + perms.include? Perm.find_by(name: constant('roles.grant_api_to_orgs')) end ##