Skip to content
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

[front] Give access to all groups for system key #9401

Merged
merged 3 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions front/lib/resources/group_resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ export class GroupResource extends BaseResource<GroupModel> {
if (key.isSystem) {
whereCondition = {
...whereCondition,
[Op.or]: [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually not sure I understand the diff here can you explain a bit more?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm removing the constraint on kind, so that we get all groups of the workspace, not only system or global

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I see that makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix/update the comment above 🙏

{ kind: { [Op.in]: ["system", "global"] } },
{ id: key.groupId },
],
};
} else {
// If it's not a system key, we only fetch the associated group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ async function handler(
if (
!dataSource ||
dataSource.space.sId !== spaceId ||
(!dataSource.canRead(auth) && !auth.isSystemKey())
!dataSource.canRead(auth)
) {
return apiError(req, res, {
status_code: 404,
Expand Down
Loading