mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-02 20:32:19 +00:00
feat: add administrator role permission table (#11817)
This update introduces a new table for managing administrator role permissions, along with the necessary repository and projection logic to handle adding and removing permissions. It also includes tests to ensure the correct functionality of the permission management system. closes https://github.com/zitadel/zitadel/issues/10219 --------- Co-authored-by: Marco Ardizzone <[email protected]>
This commit is contained in:
co-authored by
Marco Ardizzone
parent
bb3b52dda3
commit
7b9d2b7d17
+16
@@ -0,0 +1,16 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
)
|
||||
|
||||
var (
|
||||
//go:embed 018_administrator_role_permissions_table/up.sql
|
||||
up018AdministratorRolePermissionsTable string
|
||||
//go:embed 018_administrator_role_permissions_table/down.sql
|
||||
down018AdministratorRolePermissionsTable string
|
||||
)
|
||||
|
||||
func init() {
|
||||
registerSQLMigration(18, up018AdministratorRolePermissionsTable, down018AdministratorRolePermissionsTable)
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS zitadel.administrator_role_permissions;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
CREATE TABLE zitadel.administrator_role_permissions(
|
||||
instance_id TEXT NOT NULL
|
||||
, role_name TEXT NOT NULL CHECK (role_name <> '')
|
||||
, permission TEXT NOT NULL CHECK (permission <> '')
|
||||
|
||||
, PRIMARY KEY (instance_id, permission, role_name)
|
||||
, FOREIGN KEY (instance_id) REFERENCES zitadel.instances(id) ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user