You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 18, 2024. It is now read-only.
I may be missing something obvious, but ideally I would like to arrange my access classes into another folder as they grow. I have tried to use the source_class method on the originating class but without success.
Playing with the gem I managed to get what I needed working temporarily by adding another line to the registry
# vendor/gems/allowy-1.0.0/lib/allowy/registry.rb
def access_control_for(subject)
# Local modification: Allow specifying the access class directly
clazz = subject.class.authorisation_class if subject.class.respond_to?(:authorisation_class)
and then just adding a direct reference to the target access class with
# models/actions/cancel_deposit.rb
def self.authorisation_class
Authorisations::CancelDepositAccess
end
# models/authorisations/cancel_deposit_access.rb
class Authorisations::CancelDepositAccess
include Allowy::AccessControl
def cancel_deposit?(cd)
context.signed_in?
end
end
Is this heading in the right direction or is there a way to work with the library?