clean up useless flash msgs. add i18n vars for app auth and object auth
This commit is contained in:
1 parent
05ded8de03
commit
f427c3803f
9 files changed
+43
-27
No files matched your search
@@ -57,7 +57,7 @@ class ApplicationController < ActionController::Base
|
||||
if is_admin?
|
||||
true
|
||||
else
|
||||
flash[:notice] = "Access Denied for you are not Admin"
|
||||
flash[:error] = t("admin.access.denied.not_admin")
|
||||
auth_failed_in_backend
|
||||
end
|
||||
end
|
||||
@@ -66,7 +66,7 @@ class ApplicationController < ActionController::Base
|
||||
if is_manager?
|
||||
true
|
||||
else
|
||||
flash[:notice] = "Access Denied for you are not Manager for this app"
|
||||
flash[:error] = t("admin.access.denied.app.not_manager")
|
||||
auth_failed_in_backend
|
||||
end
|
||||
end
|
||||
@@ -75,7 +75,7 @@ class ApplicationController < ActionController::Base
|
||||
if (@module_app.sub_managing_users.include?(current_user) || is_manager?)
|
||||
true
|
||||
else
|
||||
flash[:notice] = "Access Denied for you are not SubManager for this app"
|
||||
flash[:error] = t("admin.access.denied.app.not_sub_manager")
|
||||
auth_failed_in_backend
|
||||
end
|
||||
end
|
||||
@@ -84,13 +84,13 @@ class ApplicationController < ActionController::Base
|
||||
if (@module_app.app_auth.auth_users.include?(current_user) || for_app_sub_manager )
|
||||
true
|
||||
else
|
||||
flash[:notice] = "Access Denied for you are not User for this app"
|
||||
flash[:error] = t("admin.access.denied.app.not_authed_user")
|
||||
auth_failed_in_backend
|
||||
end
|
||||
end
|
||||
|
||||
def check_object_premission(obj,title)
|
||||
flash[:notice] = "Access Denied for you don't have permission for this object"
|
||||
flash[:error] = t("admin.access.denied.object")
|
||||
auth_failed_in_backend unless (obj.get_object_auth_by_title(title).auth_users.include?(current_user) || is_manager? || is_admin? )
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user