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 the managers checking wrong fields for editing permissions #1005

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

BentiGorlich
Copy link
Member

I noticed that editing an entry was not really working sometimes, the reason being (after testing locally) that it tries to parse a url from the users and magazines apId. This is not working, as the ap id looks like this: [email protected]

That is not a url, so yeah that cannot work. Since this has been used to check whether a user is from the same instance as the content they try to edit, this check is failing, when the magazines ap id is not used, since one of the checks is $magazineHost === $userHost

However if the UpdateMessage is sent to another instance to which the magazine is a remote magazine (through user follows). This check is basically bypassed, because $magazineHost and $userHost are both null since the url check failed...

Fixes Regression from #893

I noticed that editing an entry was not really working sometimes, the reason being (after testing locally) that it tries to parse a url from the users and magazines apId. This is not working, as the ap id looks like this: `[email protected]`

That is not a url, so yeah that cannot work. Since this has been used to check whether a user is from the same instance as the content they try to edit, this check is failing. So right now only remote moderators can edit their content

Fixes Regression from #893
@BentiGorlich BentiGorlich added bug Something isn't working activitypub ActivityPub related issues backend Backend related issues and pull requests high priority critical issue or PR that impacts production labels Aug 7, 2024
@BentiGorlich BentiGorlich added this to the v1.8.0 milestone Aug 7, 2024
@BentiGorlich BentiGorlich self-assigned this Aug 7, 2024
@BentiGorlich BentiGorlich enabled auto-merge (squash) August 7, 2024 11:50
@BentiGorlich BentiGorlich merged commit 710755d into main Aug 7, 2024
7 checks passed
@BentiGorlich BentiGorlich deleted the fix/wrong-edit-permission-checks branch August 7, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
activitypub ActivityPub related issues backend Backend related issues and pull requests bug Something isn't working high priority critical issue or PR that impacts production
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant