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

Enforce Favorite&Share Permissions #4325

Merged
merged 2 commits into from Nov 13, 2023
Merged

Conversation

kobergj
Copy link
Contributor

@kobergj kobergj commented Nov 9, 2023

See owncloud/ocis#7497 for details

@kobergj kobergj requested review from labkode, a team and glpatcern as code owners November 9, 2023 13:32
@kobergj kobergj force-pushed the EnforcePermissions branch 4 times, most recently from d640629 to 4720f0a Compare November 9, 2023 13:47
Signed-off-by: jkoberg <jkoberg@owncloud.com>
@@ -217,6 +218,17 @@ func (s *svc) handleProppatch(ctx context.Context, w http.ResponseWriter, r *htt
return nil, nil, false
}
currentUser := ctxpkg.ContextMustGetUser(ctx)
ok, err := utils.CheckPermission(ctx, "Favorites.Write", client)
Copy link

Choose a reason for hiding this comment

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

Can we use the constant WriteFavorites from a pkg/permission/permission.go instead of the "Favorites.Write"?

Copy link

Choose a reason for hiding this comment

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

utils.CheckPermission(ctx, permission.WriteFavorites, client)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Excellent idea 👍 I did it for other occurrences of CheckPermission too. Please double check.

Signed-off-by: jkoberg <jkoberg@owncloud.com>
@kobergj kobergj requested a review from 2403905 November 13, 2023 14:15
@kobergj kobergj merged commit e258a7c into cs3org:edge Nov 13, 2023
9 checks passed
@kobergj kobergj deleted the EnforcePermissions branch November 13, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants