Bugfixes & Model for participants

This commit is contained in:
2026-02-17 21:58:55 +01:00
parent fcf41c5d13
commit b1c333648a
14 changed files with 334 additions and 56 deletions

View File

@@ -68,18 +68,22 @@ class CostUnitRepository {
$canSeeAll = false;
$user = Auth()->user();
if ($tenant->slug !== 'lv') {
if (
$user->user_role_main === UserRole::USER_ROLE_ADMIN ||
in_array( $user->user_role_local_group, [UserRole::USER_ROLE_GROUP_LEADER, UserRole::USER_ROLE_ADMIN])
) {
$canSeeAll = true;
}
if ($disableAccessCheck) {
$canSeeAll = true;
} else {
if (
in_array( $user->user_role_main, [UserRole::USER_ROLE_GROUP_LEADER, UserRole::USER_ROLE_ADMIN])
) {
$canSeeAll = true;
if ($tenant->slug !== 'lv') {
if (
$user->user_role_main === UserRole::USER_ROLE_ADMIN ||
in_array($user->user_role_local_group, [UserRole::USER_ROLE_GROUP_LEADER, UserRole::USER_ROLE_ADMIN])
) {
$canSeeAll = true;
}
} else {
if (
in_array($user->user_role_main, [UserRole::USER_ROLE_GROUP_LEADER, UserRole::USER_ROLE_ADMIN])
) {
$canSeeAll = true;
}
}
}

View File

@@ -27,18 +27,22 @@ class EventRepository {
$canSeeAll = false;
$user = Auth()->user();
if ($tenant->slug !== 'lv') {
if (
$user->user_role_main === UserRole::USER_ROLE_ADMIN ||
in_array( $user->user_role_local_group, [UserRole::USER_ROLE_GROUP_LEADER, UserRole::USER_ROLE_ADMIN])
) {
$canSeeAll = true;
}
if (!$accessCheck) {
$canSeeAll = true;
} else {
if (
in_array( $user->user_role_main, [UserRole::USER_ROLE_GROUP_LEADER, UserRole::USER_ROLE_ADMIN])
) {
$canSeeAll = true;
if ($tenant->slug !== 'lv') {
if (
$user->user_role_main === UserRole::USER_ROLE_ADMIN ||
in_array($user->user_role_local_group, [UserRole::USER_ROLE_GROUP_LEADER, UserRole::USER_ROLE_ADMIN])
) {
$canSeeAll = true;
}
} else {
if (
in_array($user->user_role_main, [UserRole::USER_ROLE_GROUP_LEADER, UserRole::USER_ROLE_ADMIN])
) {
$canSeeAll = true;
}
}
}