While working on the OpenAcaDept distribution, I have realized that it will be very nice to have additional permissions. We have 3 main roles: student, alumnus, faculty/staff. Currently it is configured that each role have access to specific profile fields. It works good when user is editing own profile, however there are some issues when administrator is editing any profile. Administrator can see any fields in this case, which should not happen.
So the idea is to introduce new permissions:
a) Allow other users to edit field_name of entity depending on the author role
b) Allow other users to view field_name of entity depending on the author role
There are similar issue here http://drupal.org/node/1107994, which was closed, cause of probable permissions issue. I don't see there any performance issues.
All permissions should work for any entity which have uid in the data schema.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | new-permissions-1339068-2.patch | 6.63 KB | Alex Komm |
| #1 | new-permissions-1339068-1.patch | 6.21 KB | Alex Komm |
Comments
Comment #1
Alex Komm commentedComment #2
dealancer commentedIn general look very nice, however there are some minor spacing and logical issues.
Spacing issue - spaces on empty line.
Spacing issue
Spacing issue
We have placed this check after this lines of code:
This brings some confusion to logic. If view own fielf permissions is unset, then permission 'view created by role' is checked, otherwise it is ignored.
I think there should be OR logic between 'view own field' permission and 'view created by role' permission, and we need to accacmulate return result in variable trough OR operator and then return it.
The same is applicable for edit permissions.
Spacing issue
Spacing issue
Comment #3
Alex Komm commentedFixed logic and spacing issues
Comment #4
Alex Komm commentedComment #6
hanoiiI think #1448154: Allow other modules to extend this module via alterers and hooks is a more flexible solution for this and is somehow more likely to be included.
If you can go, test and comment, that'd be great.
Comment #6.0
hanoiiUpdating issue
Comment #7
mariacha1 commentedCalling this a duplicate of https://www.drupal.org/node/1448154