Module permissions are shown without reason (#7451)

* Module permissions are shown without reason

* Module permissions are shown without reason

---------

Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
This commit is contained in:
Gevorg Mansuryan 2025-03-03 14:30:30 +04:00 committed by GitHub
parent dae937387c
commit 8d93280ae4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -7,6 +7,7 @@ HumHub Changelog
- Enh #7425: Installer Wording update due to `.env` configuration
- Enh #7433: Use strikethrough style for disabled user name
- Enh #7444: Rename Mailer settings keys to work with `.env`
- Fix #7451: Fix Module permissions visibility in content containers when not enabled
- Fix #7450: Fix stream load suppressed when previous content is deleted/archived
1.17.1 (Unreleased)

View File

@ -465,11 +465,17 @@ class PermissionManager extends Component
*/
public function createPermissionArray($groupId, $returnOnlyChangeable = false)
{
$permissions = [];
foreach ($this->getPermissions() as $permission) {
/** @var $permission BasePermission */
if ($returnOnlyChangeable && !$permission->canChangeState($groupId)) {
if (
$returnOnlyChangeable && !$permission->canChangeState($groupId) ||
(
$this->contentContainer &&
array_key_exists($permission->moduleId, $this->contentContainer->moduleManager->getInstallable())
&& !$this->contentContainer->moduleManager->isEnabled($permission->moduleId)
)
) {
continue;
}