Skip to content

Commit

Permalink
maint: Tidy up permissions check on services
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerSelwyn committed Oct 23, 2024
1 parent b0262be commit 1735fb4
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,7 @@ async def async_delete_event(
async def async_create_calendar_event(self, subject, start, end, **kwargs):
"""Create the event."""

if not self._validate_permissions("create"):
return
self._validate_permissions("create")

calendar = self.data.calendar

Expand All @@ -377,8 +376,7 @@ async def async_modify_calendar_event(
):
"""Modify the event."""

if not self._validate_permissions("modify"):
return
self._validate_permissions("modify")

if self.data.group_calendar:
_group_calendar_log(self.entity_id)
Expand Down Expand Up @@ -421,8 +419,7 @@ async def async_remove_calendar_event(
recurrence_range: str | None = None,
):
"""Remove the event."""
if not self._validate_permissions("delete"):
return
self._validate_permissions("delete")

if self.data.group_calendar:
_group_calendar_log(self.entity_id)
Expand All @@ -449,8 +446,7 @@ async def async_respond_calendar_event(
self, event_id, response, send_response=True, message=None
):
"""Respond to calendar event."""
if not self._validate_permissions("respond to"):
return
self._validate_permissions("respond to")

if self.data.group_calendar:
_group_calendar_log(self.entity_id)
Expand Down

0 comments on commit 1735fb4

Please sign in to comment.