class ActiveAdmin::AuthorizationAdapter
def normalized(klass)
end
end
true
when normalized(Post)
case subject
def authorized?(action, subject = nil)
class MyAuthAdapter < ActiveAdmin::AuthorizationAdapter
The above now becomes:
which implements `===` to be matched in a case statement.
To handle this, the normalized method takes care of returning a object
end
end
end
end
true
if subject == Post
when Class
true
when Post
case subject
def authorized?(action, subject = nil)
class MyAuthAdapter < ActiveAdmin::AuthorizationAdapter
For example:
class level match and the instance level match.
case statements for authorization since you have to handle both the
as classes of objects. This can make it much difficult to create simple
The `#authorized?` method's subject can be set to both instances as well
def normalized(klass) NormalizedMatcher.new(klass) end