Closed (fixed)
Project:
Hide Vertical Tabs
Version:
7.x-1.0-beta1
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Apr 2014 at 14:16 UTC
Updated:
18 Mar 2016 at 18:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jive01 commentedagreed... it says it can do this (additional_settings) whatever that means....
Comment #2
skwashd commentedI'd accept a patch for this enhancement. I recommend the following implementation:
* Create hook_permission() to add a permission for hiding the tabs
* Call user_access() in the top of the hook_form_alter() implementation and if the tabs shouldn't be hidden return early
Comment #3
rafaolf commentedGoing to look into this.
Comment #4
rafaolf commentedPer @skwashd comment, I've created the role-based permission.
Also, if the current user doesn't have the permission to disable or enable the vertical tab, it was loading the variable status. Which implies that the user won't be able to see these tabs if they aren't enabled and not even change this visibility setting. So, I've made a permission verification before hiding them.
Comment #5
rodrigoeg commentedComment #6
rodrigoeg commentedThe parts of the patch that adds and controls the permission are working fine. Please check the following comments about the code and the proposed change:
The title normally does not have a full stop at the end of the phrase.
This line is bypassing the configuration when the user does not have permission to change the configuration (if a user has permission to edit contents but does not have the permission 'administer hide_vtabs', he/she will always see the tabs). It maybe can cause some confusions when configuring this option and also will change the behavior for site that already uses this module.
Also, I think another approach of the solution would be adding a control of tabs visualization per role.
Comment #7
rafaolf commented@rodrigoeg,
Patch fixed. Also, I've opened a new feature (https://www.drupal.org/node/2668198) to make it role-based on content type level.
Comment #8
rodrigoeg commentedThanks @rafaolf,
I have reviewed and tested this new version. Moving to RTBC.
Comment #10
jribeiro commentedPushed to dev branch. Thanks for the work guys.