feat: add groups administration #372

This commit is contained in:
Simon 2026-01-27 21:55:17 +01:00
parent f05fae3ea3
commit 6faa9847f4
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
9 changed files with 701 additions and 7 deletions

View file

@ -112,7 +112,10 @@ defmodule Mv.Authorization.PermissionSets do
%{resource: "CustomFieldValue", action: :destroy, scope: :linked, granted: true},
# CustomField: Can read all (needed for forms)
%{resource: "CustomField", action: :read, scope: :all, granted: true}
%{resource: "CustomField", action: :read, scope: :all, granted: true},
# Group: Can read all (needed for viewing groups)
%{resource: "Group", action: :read, scope: :all, granted: true}
],
pages: [
# Home page
@ -141,7 +144,10 @@ defmodule Mv.Authorization.PermissionSets do
%{resource: "CustomFieldValue", action: :read, scope: :all, granted: true},
# CustomField: Can read all
%{resource: "CustomField", action: :read, scope: :all, granted: true}
%{resource: "CustomField", action: :read, scope: :all, granted: true},
# Group: Can read all
%{resource: "Group", action: :read, scope: :all, granted: true}
],
pages: [
"/",
@ -154,7 +160,11 @@ defmodule Mv.Authorization.PermissionSets do
# Custom field values overview
"/custom_field_values",
# Custom field value detail
"/custom_field_values/:id"
"/custom_field_values/:id",
# Groups overview
"/groups",
# Group detail
"/groups/:slug"
]
}
end
@ -181,7 +191,10 @@ defmodule Mv.Authorization.PermissionSets do
%{resource: "CustomFieldValue", action: :destroy, scope: :all, granted: true},
# CustomField: Read only (admin manages definitions)
%{resource: "CustomField", action: :read, scope: :all, granted: true}
%{resource: "CustomField", action: :read, scope: :all, granted: true},
# Group: Can read all
%{resource: "Group", action: :read, scope: :all, granted: true}
],
pages: [
"/",
@ -197,7 +210,11 @@ defmodule Mv.Authorization.PermissionSets do
# Custom field value detail
"/custom_field_values/:id",
"/custom_field_values/new",
"/custom_field_values/:id/edit"
"/custom_field_values/:id/edit",
# Groups overview
"/groups",
# Group detail
"/groups/:slug"
]
}
end
@ -233,7 +250,13 @@ defmodule Mv.Authorization.PermissionSets do
%{resource: "Role", action: :read, scope: :all, granted: true},
%{resource: "Role", action: :create, scope: :all, granted: true},
%{resource: "Role", action: :update, scope: :all, granted: true},
%{resource: "Role", action: :destroy, scope: :all, granted: true}
%{resource: "Role", action: :destroy, scope: :all, granted: true},
# Group: Full CRUD (admin manages groups)
%{resource: "Group", action: :read, scope: :all, granted: true},
%{resource: "Group", action: :create, scope: :all, granted: true},
%{resource: "Group", action: :update, scope: :all, granted: true},
%{resource: "Group", action: :destroy, scope: :all, granted: true}
],
pages: [
# Wildcard: Admin can access all pages