Skip to content

Commit

Permalink
Added note
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Mar 26, 2024
1 parent 18ef7f0 commit 01f164a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ee/api/rbac/access_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from ee.models.rbac.access_control import AccessControl
from posthog.models.scopes import API_SCOPE_OBJECTS
from posthog.rbac.user_access_control import (
ACCESS_CONTROL_LEVELS_RESOURCE,
UserAccessControl,
default_access_level,
highest_access_level,
Expand Down Expand Up @@ -129,7 +130,10 @@ def _get_access_controls(self, request: Request, role_based=False):
return Response(
{
"access_controls": serializer.data,
"available_access_levels": ordered_access_levels(resource),
# NOTE: For Role based controls we are always configuring resource level items
"available_access_levels": ACCESS_CONTROL_LEVELS_RESOURCE
if role_based
else ordered_access_levels(resource),
"default_access_level": "editor" if role_based else default_access_level(resource),
"user_access_level": user_access_level,
"user_can_edit_access_levels": self.user_access_control.check_can_modify_access_levels_for_object(obj),
Expand Down

0 comments on commit 01f164a

Please sign in to comment.