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?

Comments

damienmckenna’s picture

Status: Active » Needs work
StatusFileSize
new1.82 KB
new1.82 KB

Here 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.

janusman’s picture

I 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.

damienmckenna’s picture

Title: Change taxonomy permissions to use vocabulary name rather than vid » Change taxonomy permissions to use $vocabulary->machine_name rather than vid
StatusFileSize
new1.85 KB
new1.85 KB

Corrected the patches to use $vocabulary->machine_name, not $vocabulary->name.

xjm’s picture

Status: Needs work » Closed (duplicate)
xjm’s picture

Issue summary: View changes

The correct field that should be used is $vocabulary->machine_name, not $vocabulary->name.