diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0a08ec43..68f49e3b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -46,8 +46,7 @@ class ApplicationController < ActionController::Base # Check if the current_user is admin def is_admin? - - auth_failed_in_backend unless current_user.admin? + current_user.admin? ? true : auth_failed_in_backend end def is_manager? @@ -67,27 +66,27 @@ class ApplicationController < ActionController::Base if is_manager? true else - flash[:error] = t("admin.access.denied.app.not_manager") - auth_failed_in_backend - end + flash[:error] = t("admin.access.denied.app.not_manager") + auth_failed_in_backend + end end def for_app_sub_manager if (@module_app.sub_managing_users.include?(current_user) || is_manager?) true else - flash[:error] = t("admin.access.denied.app.not_sub_manager") - auth_failed_in_backend - end + flash[:error] = t("admin.access.denied.app.not_sub_manager") + auth_failed_in_backend + end end def for_app_user if (@module_app.app_auth.auth_users.include?(current_user) || for_app_sub_manager ) true else - flash[:error] = t("admin.access.denied.app.not_authed_user") - auth_failed_in_backend - end + flash[:error] = t("admin.access.denied.app.not_authed_user") + auth_failed_in_backend + end end def check_object_premission(obj,title) diff --git a/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb b/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb index 35a3afee..666bcf4e 100644 --- a/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb +++ b/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb @@ -1,6 +1,6 @@ module Panel::News::BackEnd::NewsBulletinsHelper - def show_approval_link(news_bulletin) + def news_show_approval_link(news_bulletin) by_news_bulletin = (!news_bulletin.is_expired? and !news_bulletin.is_checked?) by_user = news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) or is_manager? by_news_bulletin and by_user diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb index 976cab00..b84e89b9 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb @@ -54,7 +54,7 @@ <% end %>