feat: add PermissionSets stub module for role validation
Add minimal PermissionSets module with all_permission_sets/0 function to support permission_set_name validation in Role resource.
This commit is contained in:
parent
f8da12ad08
commit
37d1655227
1 changed files with 34 additions and 0 deletions
34
lib/mv/authorization/permission_sets.ex
Normal file
34
lib/mv/authorization/permission_sets.ex
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
defmodule Mv.Authorization.PermissionSets do
|
||||||
|
@moduledoc """
|
||||||
|
Defines the four hardcoded permission sets for the application.
|
||||||
|
|
||||||
|
This is a minimal stub implementation for Issue #1. The full implementation
|
||||||
|
with all permission details will be added in Issue #2.
|
||||||
|
|
||||||
|
## Permission Sets
|
||||||
|
|
||||||
|
1. **own_data** - Default for "Mitglied" role
|
||||||
|
2. **read_only** - For "Vorstand" and "Buchhaltung" roles
|
||||||
|
3. **normal_user** - For "Kassenwart" role
|
||||||
|
4. **admin** - For "Admin" role
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
# Get list of all valid permission set names
|
||||||
|
PermissionSets.all_permission_sets()
|
||||||
|
# => [:own_data, :read_only, :normal_user, :admin]
|
||||||
|
"""
|
||||||
|
|
||||||
|
@doc """
|
||||||
|
Returns the list of all valid permission set names.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
iex> PermissionSets.all_permission_sets()
|
||||||
|
[:own_data, :read_only, :normal_user, :admin]
|
||||||
|
"""
|
||||||
|
@spec all_permission_sets() :: [atom()]
|
||||||
|
def all_permission_sets do
|
||||||
|
[:own_data, :read_only, :normal_user, :admin]
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue