mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-11-05 04:28:36 +02:00
[PR 1] Add experimental Custom Roles foundation (#7847)
This commit is contained in:
20 files changed
+621
-68
No files matched your search
@@ -0,0 +1,19 @@
|
||||
-- Dropping the permissions would silently take them away from the Custom members, who would also keep a role (4) the
|
||||
-- versions before this one don't know. So while there are any, this fails on the duplicate key below: change their
|
||||
-- role first, or restore the backup taken before the upgrade. It needs to run in one transaction, as Diesel does.
|
||||
CREATE TEMPORARY TABLE custom_role_downgrade (blocked_by VARCHAR(255) NOT NULL PRIMARY KEY);
|
||||
INSERT INTO custom_role_downgrade VALUES ('Custom members: change their role first, or restore the backup taken before the upgrade');
|
||||
INSERT INTO custom_role_downgrade
|
||||
SELECT 'Custom members: change their role first, or restore the backup taken before the upgrade'
|
||||
FROM users_organizations WHERE atype = 4 LIMIT 1;
|
||||
DROP TABLE custom_role_downgrade;
|
||||
|
||||
ALTER TABLE users_organizations DROP COLUMN manage_users;
|
||||
ALTER TABLE users_organizations DROP COLUMN manage_groups;
|
||||
ALTER TABLE users_organizations DROP COLUMN manage_policies;
|
||||
ALTER TABLE users_organizations DROP COLUMN create_new_collections;
|
||||
ALTER TABLE users_organizations DROP COLUMN edit_any_collection;
|
||||
ALTER TABLE users_organizations DROP COLUMN delete_any_collection;
|
||||
ALTER TABLE users_organizations DROP COLUMN access_event_logs;
|
||||
ALTER TABLE users_organizations DROP COLUMN access_import_export;
|
||||
ALTER TABLE users_organizations DROP COLUMN access_reports;
|
||||
@@ -0,0 +1,11 @@
|
||||
-- The granular permissions of the Custom member role. They only take effect on a Custom membership
|
||||
-- (atype 4) while EXPERIMENTAL_CUSTOM_ROLES is enabled, and every existing membership starts without any.
|
||||
ALTER TABLE users_organizations ADD COLUMN manage_users BOOLEAN NOT NULL DEFAULT 0; -- FALSE
|
||||
ALTER TABLE users_organizations ADD COLUMN manage_groups BOOLEAN NOT NULL DEFAULT 0; -- FALSE
|
||||
ALTER TABLE users_organizations ADD COLUMN manage_policies BOOLEAN NOT NULL DEFAULT 0; -- FALSE
|
||||
ALTER TABLE users_organizations ADD COLUMN create_new_collections BOOLEAN NOT NULL DEFAULT 0; -- FALSE
|
||||
ALTER TABLE users_organizations ADD COLUMN edit_any_collection BOOLEAN NOT NULL DEFAULT 0; -- FALSE
|
||||
ALTER TABLE users_organizations ADD COLUMN delete_any_collection BOOLEAN NOT NULL DEFAULT 0; -- FALSE
|
||||
ALTER TABLE users_organizations ADD COLUMN access_event_logs BOOLEAN NOT NULL DEFAULT 0; -- FALSE
|
||||
ALTER TABLE users_organizations ADD COLUMN access_import_export BOOLEAN NOT NULL DEFAULT 0; -- FALSE
|
||||
ALTER TABLE users_organizations ADD COLUMN access_reports BOOLEAN NOT NULL DEFAULT 0; -- FALSE
|
||||
Reference in new issue
Block a user