Various code cleanup and fixed alignments.

This commit is contained in:
James Cole
2024-01-01 14:43:56 +01:00
parent 1368aafe5f
commit f963ac63f1
443 changed files with 3668 additions and 3672 deletions

View File

@@ -111,16 +111,16 @@ class UserGroup extends Model
$userGroupId = (int)$value;
/** @var User $user */
$user = auth()->user();
$user = auth()->user();
/** @var null|UserGroup $userGroup */
$userGroup = self::find($userGroupId);
$userGroup = self::find($userGroupId);
if (null === $userGroup) {
throw new NotFoundHttpException();
}
// need at least ready only to be aware of the user group's existence,
// but owner/full role (in the group) or global owner role may overrule this.
$access = $user->hasRoleInGroupOrOwner($userGroup, UserRoleEnum::READ_ONLY) || $user->hasRole('owner');
$access = $user->hasRoleInGroupOrOwner($userGroup, UserRoleEnum::READ_ONLY) || $user->hasRole('owner');
if ($access) {
return $userGroup;
}