feat: create Authorization domain
Add Mv.Authorization domain with AshAdmin and AshPhoenix extensions. Register domain in config for role management.
This commit is contained in:
parent
37d1655227
commit
1b2927ce40
1 changed files with 30 additions and 0 deletions
30
lib/mv/authorization/authorization.ex
Normal file
30
lib/mv/authorization/authorization.ex
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
defmodule Mv.Authorization do
|
||||||
|
@moduledoc """
|
||||||
|
Ash Domain for authorization and role management.
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
- `Role` - User roles that reference permission sets
|
||||||
|
|
||||||
|
## Public API
|
||||||
|
The domain exposes these main actions:
|
||||||
|
- Role CRUD: `create_role/1`, `list_roles/0`, `update_role/2`, `destroy_role/1`
|
||||||
|
|
||||||
|
## Admin Interface
|
||||||
|
The domain is configured with AshAdmin for management UI.
|
||||||
|
"""
|
||||||
|
use Ash.Domain,
|
||||||
|
extensions: [AshAdmin.Domain, AshPhoenix]
|
||||||
|
|
||||||
|
admin do
|
||||||
|
show? true
|
||||||
|
end
|
||||||
|
|
||||||
|
resources do
|
||||||
|
resource Mv.Authorization.Role do
|
||||||
|
define :create_role, action: :create_role
|
||||||
|
define :list_roles, action: :read
|
||||||
|
define :update_role, action: :update_role
|
||||||
|
define :destroy_role, action: :destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue