Skip to content

Commit

Permalink
fixed unlogged users bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Andcool-Systems committed Oct 3, 2024
1 parent 3242fe4 commit 4babc84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/workshop/bandage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ export class BandageService {
if (session) {
if (session.user.id === bandage.User?.id) permissions_level = 1;
if (hasAccess(session.user, RolesEnum.ManageBandages) || (session.user.id === bandage.User?.id && hidden)) permissions_level = 2;
if (hasAccess(session.user, RolesEnum.ForbidSelfHarm, true)) permissions_level = 0;
}

const me_profile = session && session.user.profile && session.user.UserSettings?.autoload ? {
Expand All @@ -300,7 +301,6 @@ export class BandageService {
if (bandage.categories.some(val => val.id === 4)) check = "under review";
if (bandage.categories.some(val => val.id === 13)) check = "denied";

if (hasAccess(session.user, RolesEnum.ForbidSelfHarm, true)) permissions_level = 0;

return {
statusCode: 200,
Expand Down

0 comments on commit 4babc84

Please sign in to comment.