-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Magic tokens for sharing filtered dashboards to non-users (#5071)
* Magic tokens for sharing filtered dashboards to non-users * Change preset_filter to filter * Review comments * Add token attributes * Fix test * Add dedicated permissions for bookmarks to show magic tokens can't use them * Progress commit * Logic for intersecting include/excludes * Fix lint * Self review * CLI commands * Self review 2 * Review 3 * Move share-url cmd to root * Fix downloads * Fix merge * Fix test
- Loading branch information
1 parent
11ace61
commit c422dd8
Showing
77 changed files
with
10,904 additions
and
5,959 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
CREATE TABLE magic_auth_tokens ( | ||
id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, | ||
secret_hash BYTEA NOT NULL, | ||
project_id UUID NOT NULL REFERENCES projects (id) ON DELETE CASCADE, | ||
created_on TIMESTAMPTZ DEFAULT now() NOT NULL, | ||
expires_on TIMESTAMPTZ, | ||
used_on TIMESTAMPTZ DEFAULT now() NOT NULL, | ||
created_by_user_id UUID REFERENCES users (id) ON DELETE SET NULL, | ||
attributes JSONB DEFAULT '{}'::JSONB NOT NULL, | ||
metrics_view TEXT NOT NULL, | ||
metrics_view_filter_json TEXT NOT NULL, | ||
metrics_view_fields TEXT[] NOT NULL | ||
); | ||
|
||
CREATE INDEX magic_auth_tokens_project_id_idx ON magic_auth_tokens (project_id); | ||
CREATE INDEX magic_auth_tokens_created_by_user_id_idx ON magic_auth_tokens (created_by_user_id) WHERE created_by_user_id IS NOT NULL; | ||
|
||
ALTER TABLE project_roles ADD create_magic_auth_tokens BOOLEAN DEFAULT false NOT NULL; | ||
UPDATE project_roles SET create_magic_auth_tokens = manage_project_members; | ||
|
||
ALTER TABLE project_roles ADD manage_magic_auth_tokens BOOLEAN DEFAULT false NOT NULL; | ||
UPDATE project_roles SET manage_magic_auth_tokens = manage_project_members; | ||
|
||
ALTER TABLE project_roles ADD create_bookmarks BOOLEAN DEFAULT false NOT NULL; | ||
UPDATE project_roles SET create_bookmarks = read_project; | ||
|
||
ALTER TABLE project_roles ADD manage_bookmarks BOOLEAN DEFAULT false NOT NULL; | ||
UPDATE project_roles SET manage_bookmarks = manage_project; |
Oops, something went wrong.
c422dd8
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.
🎉 Published on https://ui.rilldata.in as production
🚀 Deployed on https://6672b9a7076d6e039366673e--rill-ui-dev.netlify.app