app/controllers/decidim/meetings/admin/invites_controller.rb in decidim-meetings-0.11.2 vs app/controllers/decidim/meetings/admin/invites_controller.rb in decidim-meetings-0.12.0.pre
- old
+ new
@@ -7,13 +7,17 @@
module Admin
# Controller that allows inviting users to join a meeting.
#
class InvitesController < Admin::ApplicationController
def new
+ enforce_permission_to :invite_user, :meeting, meeting: meeting
+
@form = form(MeetingRegistrationInviteForm).instance
end
def create
+ enforce_permission_to :invite_user, :meeting, meeting: meeting
+
@form = form(MeetingRegistrationInviteForm).from_params(params)
InviteUserToJoinMeeting.call(@form, meeting, current_user) do
on(:ok) do
flash[:notice] = I18n.t("invites.create.success", scope: "decidim.meetings.admin")