trestle
trestle copied to clipboard
Authorization
User authorization support via Pundit is fairly high on the list of priorities for https://github.com/TrestleAdmin/trestle-auth. However it isn't currently supported yet.
Any easy way to fake it?
You could try the following:
controller do
include Pundit
def update
authorize instance
super
end
end
The exemple assumes that you have the correct policy object (app/policies).
@spohlenz Also authorization is NOT authentication, I would recommed against mixing pundit specific things into trestle-auth. There shoud be for e.g. trestle-auth, trestle-devise
and trestle-pundit.
Releveant and recommended reading: https://stackoverflow.com/questions/6556522/authentication-versus-authorization?answertab=active#tab-top