Skip to content

Commit 6f027d4

Browse files
bmartelpakelleyrobot-ci-heartex
authored
fix: DIA-2096: don't use is_owner in LSO (#7277) (#7304)
Co-authored-by: pakelley <[email protected]> Co-authored-by: robot-ci-heartex <[email protected]>
1 parent 936d7e4 commit 6f027d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

label_studio/jwt_auth/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ def has_modify_permission(self, user):
4242
"""Only organization owners/admins can modify JWT settings."""
4343
if not self.organization.has_permission(user):
4444
return False
45-
return user.is_owner or (hasattr(user, 'is_administrator') and user.is_administrator)
45+
is_owner = user.is_owner if hasattr(user, 'is_owner') else (user.id == self.organization.created_by.id)
46+
is_administrator = hasattr(user, 'is_administrator') and user.is_administrator
47+
return is_owner or is_administrator
4648

4749
def has_permission(self, user):
4850
"""Only organization owners/admins can modify JWT settings."""

0 commit comments

Comments
 (0)