KemalIdentity::Authz::Resource
Inherits KemalIdentity::Authz::Authorizable < Struct < Value < Object
The implementation this shard ships, for an application that will not add an include to
its models.
env.auth.authorize!(
"invoices:edit",
resource: KemalIdentity::Authz::Resource.new("invoice", invoice.id, {"owner_id" => invoice.owner_id}),
)
The route decides which attributes the policy needs, and that cost is deliberately visible: a route that passes the wrong ones gets a denial rather than a wrong answer, because a policy reading an attribute that is not there denies.
Constructors
Instance methods
One attribute, or nil. A policy reading a missing attribute should deny rather than
assume, which is why this returns nil instead of raising.
attributes
Whatever the policy needs and cannot derive from the type and the id: an owner, a state, a classification. Strings, so that this serialises to a remote policy engine unchanged.