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: restricted sibling tags appearing for unauthorized members on the sidebar #3419

Merged
merged 3 commits into from
Jul 4, 2022

Conversation

SychO9
Copy link
Member

@SychO9 SychO9 commented May 10, 2022

Changes proposed in this pull request:
Loading the parent.children tag relation grabs the models without checking for permissions.
This PR makes sure that the relation is passed through a permission check first (repository class code) and then if a parent.children.parent relation is also included, it manually attached that relation instead of trying to eager load it.

  • --> add parent.children to relation permission check array.
  • --> check if a parent.children.parent relation is passed in the controller.
  • --> manually attach the parent to children.
  • --> remove eager loading of parent.children.parent.
  • --> integration tests.

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

@SychO9 SychO9 self-assigned this Jun 18, 2022
@davwheat davwheat added this to the 1.4 milestone Jul 4, 2022
@davwheat davwheat merged commit bf4c543 into main Jul 4, 2022
@davwheat davwheat deleted the sm/hide-restricted-sibling-tags branch July 4, 2022 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants