Skip to content

Commit

Permalink
Fix visibility of modResource derivatives in context menus and combos (
Browse files Browse the repository at this point in the history
…#16403)

Update modResource derivatives

Ensure correct visibility of context menu items and combo options based on user permissions to create Symlinks, Weblinks, and/or Static Resources
  • Loading branch information
opengeek committed Feb 15, 2024
1 parent 24970ad commit 355f840
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion core/src/Revolution/modStaticResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public function __construct(xPDO $xpdo)
{
parent:: __construct($xpdo);
$this->set('class_key', __CLASS__);
$this->showInContextMenu = true;
$canCreate = (bool)$this->xpdo->hasPermission('new_static_resource');
$this->allowListingInClassKeyDropdown = $canCreate;
$this->showInContextMenu = $canCreate;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion core/src/Revolution/modSymLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ public function __construct(xPDO $xpdo)
parent:: __construct($xpdo);
$this->set('type', 'reference');
$this->set('class_key', __CLASS__);
$this->showInContextMenu = true;
$canCreate = (bool)$this->xpdo->hasPermission('new_symlink');
$this->allowListingInClassKeyDropdown = $canCreate;
$this->showInContextMenu = $canCreate;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion core/src/Revolution/modWebLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ public function __construct(xPDO $xpdo)
parent:: __construct($xpdo);
$this->set('type', 'reference');
$this->set('class_key', __CLASS__);
$this->showInContextMenu = true;
$canCreate = (bool)$this->xpdo->hasPermission('new_weblink');
$this->allowListingInClassKeyDropdown = $canCreate;
$this->showInContextMenu = $canCreate;
}

/**
Expand Down

0 comments on commit 355f840

Please sign in to comment.