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

Added missing permissions to Contributor & Editor #19881

Merged
merged 2 commits into from Mar 20, 2024
Merged

Commits on Mar 19, 2024

  1. Added missing permissions to Contributor & Editor

    ref ENG-728
    ref https://linear.app/tryghost/issue/ENG-728
    
    This is NOT a functionality change. The Post#permissible method unit tests have
    been updated to pass `true` as `hasUserPermission` and we can see that the
    permission functionality remains the same.
    
    The permissible method of the post model is responsible for removing permission
    based on the data that is being modified, but the permissions module is setup
    to allow the permissible method to grant permission - this means that we call
    permissible, even if the current actor doesn't have permission, this results in
    code that is hard to understand and manage.
    
    We are going to be instead returning early if an actor does not have
    permission, this will allow permissible method signatures to be greatly
    simplified (removing the need for hasUserPermission, hasApiKeyPermission &
    hasMemberPermission arguments).
    allouis committed Mar 19, 2024
    Copy the full SHA
    bc52c43 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    5fef44e View commit details
    Browse the repository at this point in the history