- Notifications
You must be signed in to change notification settings - Fork927
feat: add owner groups to workspace data#12841
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
36451d5
9a5f7f1
a8277a0
e788b3b
8e2c4fe
6b305f6
48108f8
80cfdc8
b3cd5f1
9ae8efb
da9163e
0f472eb
9add629
f55ccc1
8afb039
cf0fd5a
a4da4c6
9b82463
ebae3f8
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -28,6 +28,31 @@ FROM | ||
WHERE | ||
organization_id = $1; | ||
-- name: GetGroupsByOrganizationAndUserID :many | ||
SELECT | ||
groups.* | ||
FROM | ||
groups | ||
-- If the group is a user made group, then we need to check the group_members table. | ||
LEFT JOIN | ||
group_members | ||
ON | ||
group_members.group_id = groups.id AND | ||
group_members.user_id = @user_id | ||
-- If it is the "Everyone" group, then we need to check the organization_members table. | ||
LEFT JOIN | ||
organization_members | ||
ON | ||
organization_members.organization_id = groups.id AND | ||
organization_members.user_id = @user_id | ||
WHERE | ||
-- In either case, the group_id will only match an org or a group. | ||
(group_members.user_id = @user_id OR organization_members.user_id = @user_id) | ||
AND | ||
-- Ensure the group or organization is the specified organization. | ||
groups.organization_id = @organization_id; | ||
f0ssel marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
-- name: InsertGroup :one | ||
INSERT INTO groups ( | ||
id, | ||
Uh oh!
There was an error while loading.Please reload this page.