Manages the many-to-many relationship between users and permissions.
This resource serves as the join table that associates users with their granted permissions, forming the foundation of the role-based access control system. Each record represents a single permission assignment to a user, enabling fine-grained control over what actions users can perform throughout the system.
The resource implements upsert functionality through the assign action, preventing duplicate permission assignments while allowing efficient bulk permission updates. The unique constraint on user_id and permission_id pairs ensures that each user can only have a permission assigned once, maintaining data integrity.
A row is written through MishkaCmsCore.Accounts.User's own actions, which hold a grant to the
granter's ceiling and keep a site's admin off its own permissions, or directly by a master holding
the permission area (admin:<surface>:permission). A site's holder of that area reads the grants
of its own site's users only.
Summary
Types
Functions
Validates that the keys in the provided input are valid for at least one action on the resource.
Raises a KeyError error at compile time if not. This exists because generally a struct should only ever
be created by Ash as a result of a successful action. You should not be creating records manually in code,
e.g %MyResource{value: 1, value: 2}. Generally that is fine, but often with embedded resources it is nice
to be able to validate the keys that are being provided, e.g
Resource
|> Ash.Changeset.for_create(:create, %{embedded: EmbeddedResource.input(foo: 1, bar: 2)})
|> Ash.create()
Same as input/1, except restricts the keys to values accepted by the action provided.