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

Include updating of scoped tag permissions #2941

Merged
merged 2 commits into from
Jun 28, 2021
Merged

Conversation

imorland
Copy link
Member

@imorland imorland commented Jun 23, 2021

**Fixes #2924 **

Changes proposed in this pull request:
The rename viewDiscussions migration introduced for Flarum 1.0 does not take tag scoped permissions into account
https://github.com/flarum/core/blob/e92c267cdec46266b633f71c2f41040731cdaf39/migrations/2021_05_10_000000_rename_permissions.php#L17

This fixes the migration to additionally rename tagX.viewDiscussions to tagX.viewForum

As @clarkwinkelmann suggestion, fixing the current migration rather than introducing a new one so that this will only run for those forums which are yet to update to 1.0

Tested locally on an upgrade from core beta.16 to 1.0.3

Reviewers should focus on:
Scoped tag permissions are included in the rename of permission

Confirmed

  • Backend changes: tests are green (run composer test).

Addresses flarum#2924

The rename `viewDiscussions` migration introduced for Flarum 1.0 does not take tag scoped permissions into account
https://github.com/flarum/core/blob/e92c267cdec46266b633f71c2f41040731cdaf39/migrations/2021_05_10_000000_rename_permissions.php#L17

This adds a new migration to additionally rename `tagX.viewDiscussions` to `tagX.viewForum`

Tested locally on an upgrade from core `beta.16` to `1.0.3`
Copy link
Member

@SychO9 SychO9 left a comment

Choose a reason for hiding this comment

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

Looks good,

Interesting, we shouldn't have used LIKE with the viewUserList permission since it's not tag scopable anyway, seems like we could safely change that to '=' as well and update it in an ordinary way without the raw replace statement.

@imorland
Copy link
Member Author

To clarify, are you suggesting that change for this PR, or to keep the focus on this issue, and open an issue for altering the viewUserList seperately @SychO9 ?

@SychO9
Copy link
Member

SychO9 commented Jun 25, 2021

Since we're fixing the migration anyway and it's very straightforward, I think it's fine to do here 👍🏼

@imorland imorland requested a review from SychO9 June 26, 2021 06:21
@luceos luceos merged commit 4a5b84d into flarum:master Jun 28, 2021
@imorland imorland deleted the patch-3 branch June 28, 2021 09:59
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.

[Tags?] Migrating an old database to 1.0 resets tag scoped permissions
3 participants