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

CRM-21473: Add new permission to add contact notes and prevent users without edit contact permission to edit or delete notes #11314

Merged
merged 1 commit into from
Nov 24, 2017
Merged

Conversation

omarabuhussein
Copy link
Member

@omarabuhussein omarabuhussein commented Nov 22, 2017

Overview

Add new permission to add contact notes and prevent users without edit contact permission to edit or delete notes

Before

Currently only users with ability to "edit" contact can see "add note" button in contact page notes tab, but if the add note link civicrm/contact/view/note?cid=CONTACT_ID&action=add was access directly by a user with no ability to "edit" the contact he will still be able to access the add note button, Also the user can still edit or delete the note by direct access using the URL.

Here is an example of user who only has "view all contacts" permission, this is how notes table will appear to him :

0

And while there is not way to add, delete or edit any note from UI, you can still do it if you know which URL to use, here are some examples for each case for the same user :

Add
1

Edit
2

Delete
3

After

Now only users with "edit" ability can edit or delete notes, and a new permission is added called "add contact notes" so the user either need the ability to "edit" the contact or the new "add contact notes" permission to be able to add note for the currently viewed user.

So back to our user with only "view all contacts" permission, the notes tab will still appear as before :

0

But now the user cannot even use direct access to add,edit or delete a note :

Add
1

Edit
2

Delete
3

But additionally, we can grant this user role "add contact notes" permission :

2017-11-23 02_12_35-people _ dmaster4

which will allow the user to add notes (only add, no edit or delete will be allowed) :

2111


…without edit contact permission to edit or delete notes
@omarabuhussein omarabuhussein changed the title CRM-21473: Add new permission to add contact notes and prevent users without edit contact permission to edit or delete notes WIP CRM-21473: Add new permission to add contact notes and prevent users without edit contact permission to edit or delete notes Nov 22, 2017
@omarabuhussein omarabuhussein changed the title WIP CRM-21473: Add new permission to add contact notes and prevent users without edit contact permission to edit or delete notes CRM-21473: Add new permission to add contact notes and prevent users without edit contact permission to edit or delete notes Nov 23, 2017
@eileenmcnaughton
Copy link
Contributor

Looks promising - perhaps you could trade review with @jitendrapurohit on this one #11301 (which also looks like a fairly simple review job)

@omarabuhussein
Copy link
Member Author

yup sure @eileenmcnaughton , will do it in the weekend

Copy link
Contributor

@jitendrapurohit jitendrapurohit left a comment

Choose a reason for hiding this comment

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

@omarabuhussein @eileenmcnaughton Tested and confirmed adding, editing and deleting notes for a contact. This works as expected as shown in the list of screencast videos.

@eileenmcnaughton
Copy link
Contributor

Merging based on @jitendrapurohit reivew

@eileenmcnaughton eileenmcnaughton merged commit 7a20e67 into civicrm:master Nov 24, 2017
@jitendrapurohit
Copy link
Contributor

@omarabuhussein Are you able to review #11301 as mentioned by Eileen above?

@omarabuhussein
Copy link
Member Author

hey @jitendrapurohit , sorry I couldn't do it at weekend but I am on it currently.

@omarabuhussein omarabuhussein deleted the CRM-21473-adding-add-note-permission branch November 27, 2017 11:36
sluc23 pushed a commit to ixiam/civicrm-core that referenced this pull request Jan 10, 2018
…-add-note-permission

CRM-21473: Add new permission to add contact notes and prevent users without edit contact permission to edit or delete notes
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.

4 participants