*CURRENTLY UNMAINTAINED*. Authority helps you authorize actions in your Rails app. It's ORM-neutral and has very little fancy syntax; just group your models under one or more Authorizer classes and write plain Ruby methods on them.
This change simply splats the result of the method called to get the
resource to authorize in a controller (as a result of using the
.authorize_actions_for class method).
This will have no effect on existing calls, since the .authorize_actions_for
previously supported only a resource method that returns a single value.
This change will allow someone to return an array in their resource
method, including both the resource to authorize and options. This can
be very helpful for authorizing create actions.
For example:
class WibblesController
before_filter :load_foo
authorize_actions_for :foo_wibbles, only: :create
...
private
def foo_wibbles
[Wibble, { foo_id: @foo }]
end
end
This change simply splats the result of the method called to get the resource to authorize in a controller (as a result of using the .authorize_actions_for class method).
This will have no effect on existing calls, since the .authorize_actions_for previously supported only a resource method that returns a single value.
This change will allow someone to return an array in their resource method, including both the resource to authorize and options. This can be very helpful for authorizing create actions.
For example:
class WibblesController before_filter :load_foo authorize_actions_for :foo_wibbles, only: :create
...
private
def foo_wibbles [Wibble, { foo_id: @foo }] end end