Conversation
| user && (user.has_role?(:admin) || user == record.author) | ||
| end | ||
|
|
||
| def update? |
There was a problem hiding this comment.
@jazzygasper just one quick question. Is the intention here to allow admins and organisers to update the note of another admin/organiser? In that case this won't work for organisers, only admins. See line 3 above in the create? method. We need to check for the admin and organiser roles to allow for that.
If the intention was to allow admins to update anyone's notes but organisers to only update their own notes, this is fine.
Just wanted to clarify before I approved.
There was a problem hiding this comment.
@matyikriszta Yeah my original idea was for admins to update anyone’s notes, and organisers only their own. But I'm happy to change it so any organiser can update any note, or restrict it to organisers updating notes from their own chapter. What do you think is best?
There was a problem hiding this comment.
@jazzygasper I think we should go with the second option, e.g. organisers updating notes from their own chapter. I think this might be useful in the case if an organiser leaves but a note they left needs to be updated. Other organisers from the same chapter should be able to do this without having to ping an admin.
There was a problem hiding this comment.
@jazzygasper are you okay to make the suggested changes?
jonodrew
left a comment
There was a problem hiding this comment.
Thank you for adding this. I think it's well on its way, but there are a couple of tests failing. I don't think you can access Chapter from MemberNote, so you might need to take a look at that. Maybe MemberNote.author.chapters will give you something?
Fixes #2176
This PR adds functionality for admin to edit and delete notes associated with members.
Features: