Skip to content

Commit

Permalink
Allow CC also to edit holidays
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavberi committed Aug 24, 2024
1 parent 68b693b commit b27ca8e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mutations/holidays.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ def createHoliday(details: InputHolidayDetails, info: Info) -> HolidayType:
Create a new holiday
returns the created holiday
Allowed Roles: ["slo"]
Allowed Roles: ["slo", "cc"]
"""
user = info.context.user

if user is None or user.get("role") not in ["slo"]:
if user is None or user.get("role") not in ["slo", "cc"]:
raise ValueError("You do not have permission to access this resource.")

holiday = Holiday(
Expand All @@ -43,11 +43,11 @@ def editHoliday(
Edit an existing holiday
returns the edited holiday
Allowed Roles: ["slo"]
Allowed Roles: ["slo", "cc"]
"""
user = info.context.user

if user is None or user.get("role") not in ["slo"]:
if user is None or user.get("role") not in ["slo", "cc"]:
raise ValueError("You do not have permission to access this resource.")

holiday = holidaysdb.find_one({"_id": id})
Expand Down Expand Up @@ -76,7 +76,7 @@ def deleteHoliday(id: str, info: Info) -> bool:
"""
user = info.context.user

if user is None or user.get("role") not in ["slo"]:
if user is None or user.get("role") not in ["slo", "cc"]:
raise ValueError("You do not have permission to access this resource.")

holiday = holidaysdb.find_one({"_id": id})
Expand Down

0 comments on commit b27ca8e

Please sign in to comment.