public function stylizer_ui::access in Chaos Tool Suite (ctools) 7
Same name and namespace in other branches
- 6 stylizer/plugins/export_ui/stylizer_ui.class.php \stylizer_ui::access()
Menu callback to determine if an operation is accessible.
This function enforces a basic access check on the configured perm string, and then additional checks as needed.
Parameters
$op: The 'op' of the menu item, which is defined by 'allowed operations' and embedded into the arguments in the menu item.
$item: If an op that works on an item, then the item object, otherwise NULL.
Return value
TRUE if the current user has access, FALSE if not.
Overrides ctools_export_ui::access
File
- stylizer/
plugins/ export_ui/ stylizer_ui.class.php, line 9
Class
- stylizer_ui
- UI class for Stylizer.
Code
public function access($op, $item) {
$access = parent::access($op, $item);
if ($op == 'add' && $access && empty($this->base_types)) {
// Make sure there are base styles defined.
$access = FALSE;
}
return $access;
}