Currently the taxonomy permissions are named "delete terms in $vocabulary->vid" and "edit terms in $vocabulary->vid". Is there a reason that the $vocabulary->vid is used instead of $vocabulary->machine_name?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | drupal-n1300962-2-d7.patch | 1.85 KB | damienmckenna |
| #3 | drupal-n1300962-2-d8.patch | 1.85 KB | damienmckenna |
| #1 | drupal-n1300962-1-d7.patch | 1.82 KB | damienmckenna |
| #1 | drupal-n1300962-1-d8.patch | 1.82 KB | damienmckenna |
Comments
Comment #1
damienmckennaHere are patches for D7 and D8 to replace the two permissions use of $vocabulary->vid with $vocabulary->name. They need hook_update_N() implementations to update existing permissions, though.
Comment #2
janusman commentedI might be wrong but...
Won't permissions be lost if someone decides to rename a vocabulary?
IIUC $vocabulary->name is a user-facing label, not a UUID =) Permissions should have unique IDs of the things they.. uh... allow.
Comment #3
damienmckennaCorrected the patches to use $vocabulary->machine_name, not $vocabulary->name.
Comment #4
xjmDuplicate of #995156: Use vocabulary machine name for permissions.
Comment #4.0
xjmThe correct field that should be used is $vocabulary->machine_name, not $vocabulary->name.