Create a more accurate permissions check message
This commit is contained in:
parent
5310c7000c
commit
e7e12a38c6
4 changed files with 5 additions and 3 deletions
|
@ -23,7 +23,7 @@ class IssueCommentsController < ApplicationController
|
|||
|
||||
def check_permission
|
||||
unless current_user.administrator? || current_user.moderator?
|
||||
flash[:error] = t("application.require_admin.not_an_admin")
|
||||
flash[:error] = t("application.require_moderator_or_admin.not_a_moderator_or_admin")
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
|
|
@ -93,7 +93,7 @@ class IssuesController < ApplicationController
|
|||
|
||||
def check_permission
|
||||
unless current_user.administrator? || current_user.moderator?
|
||||
flash[:error] = t("application.require_admin.not_an_admin")
|
||||
flash[:error] = t("application.require_moderator_or_admin.not_a_moderator_or_admin")
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1789,6 +1789,8 @@ en:
|
|||
not_an_admin: You need to be an admin to perform that action.
|
||||
require_moderator:
|
||||
not_a_moderator: "You need to be a moderator to perform that action."
|
||||
require_moderator_or_admin:
|
||||
not_a_moderator_or_admin: You need to be a moderator or an admin to perform that action
|
||||
setup_user_auth:
|
||||
blocked_zero_hour: "You have an urgent message on the OpenStreetMap web site. You need to read the message before you will be able to save your edits."
|
||||
blocked: "Your access to the API has been blocked. Please log-in to the web interface to find out more."
|
||||
|
|
|
@ -7,7 +7,7 @@ class IssuesTest < ApplicationSystemTestCase
|
|||
sign_in_as(create(:user))
|
||||
|
||||
visit issues_path
|
||||
assert page.has_content?(I18n.t("application.require_admin.not_an_admin"))
|
||||
assert page.has_content?(I18n.t("application.require_moderator_or_admin.not_a_moderator_or_admin"))
|
||||
end
|
||||
|
||||
def test_view_no_issues
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue