-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b26040b
commit a946392
Showing
12 changed files
with
209 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CREATE MIGRATION m1pwk6wff5r2xbxtjeesr6x76xw6wksmmvmeqlt6rkczev3z4ch7wq | ||
ONTO m1jqxiptf66zakhlguijkgmp2fbjlar2fqrsq7d3gfsyx2tvbe7ica | ||
{ | ||
ALTER TYPE default::Permission { | ||
CREATE MULTI LINK tags -> default::Tag { | ||
ON TARGET DELETE ALLOW; | ||
}; | ||
}; | ||
ALTER TYPE default::Tag { | ||
ALTER PROPERTY name { | ||
CREATE CONSTRAINT std::exclusive; | ||
}; | ||
}; | ||
}; |
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
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 |
---|---|---|
@@ -1,19 +1,38 @@ | ||
with | ||
name := <str>$name, | ||
code := <str>$code, | ||
description := <optional str>$description, | ||
application_id := <uuid>$application_id, | ||
new_tags := ( | ||
for item in array_unpack(<array<str>>$new_tags) union ( | ||
insert Tag { | ||
name := item, | ||
tag_type := TagType.Permission | ||
} | ||
) | ||
), | ||
existing_tags := ( | ||
select Tag | ||
filter .id in array_unpack(<array<uuid>>$existing_tag_ids) | ||
) | ||
select ( | ||
insert Permission { | ||
name := <str>$name, | ||
code := <str>$code, | ||
description := <optional str>$description, | ||
name := name, | ||
code := code, | ||
description := description, | ||
application := ( | ||
select Application filter ( | ||
.id = <uuid>$application_id | ||
.id = application_id | ||
) | ||
) | ||
), | ||
tags := new_tags union existing_tags | ||
} | ||
) { | ||
name, | ||
code, | ||
description, | ||
application: { name }, | ||
tags: { name }, | ||
is_deleted, | ||
created_at | ||
} |
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
4 changes: 4 additions & 0 deletions
4
src/freeauth/permissions/queries/query_permission_tags.edgeql
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,4 @@ | ||
select Tag { | ||
id, | ||
name | ||
} filter (.tag_type = TagType.Permission) |
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
Oops, something went wrong.