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

Multiple editors with access can't edit the common article #10212

Closed
kacperduras opened this issue Nov 21, 2018 · 7 comments
Closed

Multiple editors with access can't edit the common article #10212

kacperduras opened this issue Nov 21, 2018 · 7 comments
Labels
affects:api Affects the Ghost API bug [triage] something behaving unexpectedly help wanted [triage] Ideal issues for contributors to help with server / core Issues relating to the server or core of Ghost

Comments

@kacperduras
Copy link
Contributor

kacperduras commented Nov 21, 2018

To Reproduce

  1. Create new article
  2. Add 2+ people
  3. Try edit:
    obraz

Only the first person on the list can edit the content (any time).
Editing by single person, never more in one moment.

Technical details:

  • Ghost Version: latest (2.6.1)
  • Node Version: 10.13.0 LTS
  • Browser/OS: Firefox, latest stable/W10
  • Database: MySQL
@naz
Copy link
Contributor

naz commented Nov 22, 2018

Hi @kacperduras 👋 Could you please add more details about which roles those 2+ people are assigned to, what's the role of the user who is trying to edit the post?

@naz naz added the needs:info [triage] Blocked on missing information label Nov 22, 2018
@kacperduras
Copy link
Contributor Author

Hi @gargol, they have permissions from Author template.

@naz
Copy link
Contributor

naz commented Nov 22, 2018

Thanks, @kacperduras. Just to make sure I understand this correctly: when having multiple authors (all having roles of Author) assigned to a post, only the first author in the list is able to edit the post, correct?

@kacperduras
Copy link
Contributor Author

@gargor yes

@naz
Copy link
Contributor

naz commented Nov 22, 2018

@kacperduras was able to reproduce, definitely a bug 😄

@naz naz added bug [triage] something behaving unexpectedly server / core Issues relating to the server or core of Ghost affects:api Affects the Ghost API and removed needs:info [triage] Blocked on missing information labels Nov 22, 2018
@naz
Copy link
Contributor

naz commented Nov 22, 2018

We are currently only checking primary author in the context of being able to edit the post:

            function isCurrentOwner() {
                return context.user === postModel.related('authors').models[0].id;
            }

but any co-author should be able to change the content of the post they are a co-author of. Should check if isCurrentOwner is to be modified or new method like isCoAuthor should be introduced for this change, but the body of it would be something along the lines:

postModel.related('authors').models.map(author => author.id).includes(context.user)

@naz naz added the help wanted [triage] Ideal issues for contributors to help with label Nov 22, 2018
@kacperduras
Copy link
Contributor Author

IMHO, one method is better option than separate function - we check author permissions for users, but we have the order not because of the access level, but the addition list.

I will create PR soon, maybe today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:api Affects the Ghost API bug [triage] something behaving unexpectedly help wanted [triage] Ideal issues for contributors to help with server / core Issues relating to the server or core of Ghost
Projects
None yet
Development

No branches or pull requests

2 participants