app/controllers/decidim/admin/user_groups_controller.rb in decidim-admin-0.11.2 vs app/controllers/decidim/admin/user_groups_controller.rb in decidim-admin-0.12.0.pre
- old
+ new
@@ -6,21 +6,21 @@
#
class UserGroupsController < Decidim::Admin::ApplicationController
layout "decidim/admin/users"
def index
- authorize! :index, UserGroup
+ enforce_permission_to :index, :user_group
@query = params[:q]
@state = params[:state]
@user_groups = Decidim::Admin::UserGroupsEvaluation.for(collection, @query, @state)
.page(params[:page]).per(15)
end
def verify
@user_group = collection.find(params[:id])
- authorize! :verify, @user_group
+ enforce_permission_to :verify, :user_group, user_group: @user_group
VerifyUserGroup.call(@user_group, current_user) do
on(:ok) do
flash[:notice] = I18n.t("user_group.verify.success", scope: "decidim.admin")
redirect_back(fallback_location: decidim_admin.user_groups_path)
@@ -33,10 +33,10 @@
end
end
def reject
@user_group = collection.find(params[:id])
- authorize! :reject, @user_group
+ enforce_permission_to :reject, :user_group, user_group: @user_group
RejectUserGroup.call(@user_group, current_user) do
on(:ok) do
flash[:notice] = I18n.t("user_group.reject.success", scope: "decidim.admin")
redirect_back(fallback_location: decidim_admin.user_groups_path)