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

Fix delete auth check for posts delete #3312

Merged
merged 1 commit into from
Oct 14, 2024
Merged

Conversation

CarsonF
Copy link
Member

@CarsonF CarsonF commented Oct 14, 2024

Assume the post object is all that is needed to check permissions. This is because we know we want the creator to be able to delete.

Previously other members could delete any post - this seems like a mistake. So this new code prevents that by not having the member context.

This kinda breaks the isolation I wanted these to have from policies. I wanted policies to be in full control of the permissions.

But we have to provide the right context/attributes. The project doesn't have the creator attribute (or even the right one).

We could do a better job exposing exactly what attributes are given to the privileges service instead of the dto object wholesale.

The policies are also ill-equipped to declare permissions for these "embedded" resources.
A rewrite is needed there.

Assume the post object is all that is needed to check permissions.
This is because we know we want the creator to be able to delete.

Previously other members could delete any post - this seems like a mistake.
So this new code prevents that by not having the member context.

This kinda breaks the isolation I wanted these to have from policies.
I wanted policies to be in full control of the permissions.

But we have to provide the right context/attributes.
The project doesn't have the creator attribute (or even the right one).

We could do a better job exposing exactly what attributes are given
to the privileges service instead of the dto object wholesale.

The policies are also ill-equipped to declare permissions for these
"embedded" resources.
A rewrite is needed there.
@CarsonF CarsonF requested a review from bryanjnelson October 14, 2024 15:06
Copy link
Contributor

@bryanjnelson bryanjnelson left a comment

Choose a reason for hiding this comment

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

🚀

@CarsonF CarsonF merged commit f63f929 into develop Oct 14, 2024
15 checks passed
@CarsonF CarsonF deleted the bugfix/posts-delete branch October 14, 2024 16:00
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.

2 participants