mirror of
https://github.com/System-End/identity-vault.git
synced 2026-04-19 20:55:11 +00:00
* temp commit * lemme do it * nope * let them do it too * collab invite model * better visuals on progman * waow * danger will robinson * show apps on backend & link user * first pass on app auditability! * no lastnaming admins * async frame that shit! * waugh * can't add yourself * fix reinvite * sidebar badging * lint... * gotta be on the app! * let that get rescued by applcon * already in revoke_all_authorizations * woag * the routes you grew up with no longer exist * what would the UI for that even be? * sorch * much better! * frickin validations
24 lines
651 B
Ruby
24 lines
651 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Opt-in concern for frontend controllers that want Pundit authorization
|
|
# with Identity as the authorization subject (instead of Backend::User).
|
|
#
|
|
# This does NOT affect backend controllers — they continue using
|
|
# Backend::User via Backend::ApplicationController.
|
|
module IdentityAuthorizable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
include Pundit::Authorization
|
|
after_action :verify_authorized
|
|
|
|
rescue_from Pundit::NotAuthorizedError do |_e|
|
|
flash[:error] = "You're not authorized to do that."
|
|
redirect_to root_path
|
|
end
|
|
|
|
def pundit_user
|
|
current_identity
|
|
end
|
|
end
|
|
end
|