Enh #6248: If admins can view all contents, users allowed to manage spaces or users cannot view all content (they should be able) (#6263)

Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
This commit is contained in:
Marc Farré 2023-04-27 23:07:48 +02:00 committed by GitHub
parent c8f1995e28
commit 0cc4fdd630
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@ HumHub Changelog
-------------------
- Fix #6251: Emulate execution on `readable()` content
- Enh #6252: Implement new method to handle changing of content active record state
- Enh #6248: If admins can view all contents, users allowed to manage spaces or users cannot view all content (they should be able)
- Enh #6255: Updated activities to same state as parent record
1.14.0 (April 20, 2023)

View File

@ -759,8 +759,8 @@ class User extends ContentContainerActiveRecord implements IdentityInterface, Se
return $module->adminCanViewAllContent && (
$this->isSystemAdmin()
|| ($containerClass === Space::class && $this->can(ManageSpaces::class))
|| ($containerClass === static::class && $this->can(ManageUsers::class))
|| ($containerClass === Space::class && (new PermissionManager(['subject' => $this]))->can(ManageSpaces::class))
|| ($containerClass === static::class && (new PermissionManager(['subject' => $this]))->can(ManageUsers::class))
);
}