-
Notifications
You must be signed in to change notification settings - Fork 1
NOISSUE - Remove MG related things in ATOM #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -765,39 +765,11 @@ CROSS JOIN LATERAL ( | |
| ('entity', 'entity:service'), | ||
| ('entity', 'entity:workload'), | ||
| ('entity', 'entity:application'), | ||
| ('resource', 'resource:channel'), | ||
| ('resource', 'resource:rule'), | ||
| ('resource', 'resource:report'), | ||
| ('resource', 'resource:alarm'), | ||
| ('group', NULL) | ||
| ) AS applicability(object_kind, object_type) | ||
| WHERE actions.name IN ('read', 'write', 'delete') | ||
|
Comment on lines
765
to
770
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
After removing the resource-specific rows here, there is no Useful? React with 👍 / 👎. |
||
| ; | ||
|
|
||
| INSERT INTO action_applicability (action_id, object_kind, object_type) | ||
| SELECT id, 'resource', 'resource:channel' | ||
| FROM actions | ||
| WHERE name IN ('read', 'write', 'delete', 'manage', 'publish', 'subscribe') | ||
| ON CONFLICT DO NOTHING; | ||
|
|
||
| INSERT INTO action_applicability (action_id, object_kind, object_type) | ||
| SELECT id, 'resource', 'resource:rule' | ||
| FROM actions | ||
| WHERE name IN ('read', 'write', 'delete', 'manage', 'execute') | ||
| ON CONFLICT DO NOTHING; | ||
|
|
||
| INSERT INTO action_applicability (action_id, object_kind, object_type) | ||
| SELECT id, 'resource', 'resource:report' | ||
| FROM actions | ||
| WHERE name IN ('read', 'write', 'delete', 'manage', 'execute') | ||
| ON CONFLICT DO NOTHING; | ||
|
|
||
| INSERT INTO action_applicability (action_id, object_kind, object_type) | ||
| SELECT id, 'resource', 'resource:alarm' | ||
| FROM actions | ||
| WHERE name IN ('read', 'write', 'delete', 'manage') | ||
| ON CONFLICT DO NOTHING; | ||
|
|
||
| INSERT INTO action_applicability (action_id, object_kind, object_type) | ||
| SELECT id, object_kind, object_type | ||
| FROM actions | ||
|
|
@@ -965,8 +937,6 @@ VALUES | |
| ('device', 'manage', 'resource', NULL, 'deny', TRUE), | ||
| ('device', 'delete', 'resource', NULL, 'deny', TRUE), | ||
| ('device', 'write', 'resource', NULL, 'deny', TRUE), | ||
| ('device', 'publish', 'resource', 'resource:channel', 'allow', FALSE), | ||
| ('device', 'subscribe', 'resource', 'resource:channel', 'allow', FALSE), | ||
| ('human', 'manage', 'resource', NULL, 'allow', FALSE), | ||
| ('human', 'manage', 'entity', NULL, 'allow', FALSE), | ||
| ('human', 'manage', 'group', NULL, 'allow', FALSE), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because startup runs
sqlx::migrate::Migrator::runfromsrc/main.rs, any database that has already applied migration version 1 will have the old checksum recorded in_sqlx_migrations; changing001_initial.sqlin place makes upgrades fail migration validation before the service starts. Put these seed-data removals in a newmigrations/NNN_*.sqlmigration instead of rewriting the applied initial migration.Useful? React with 👍 / 👎.