-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: remove unused UserRole.permissions_for_user (#72801)
- function contains a type error - only called in tests - last reference removed in 8bbc88d <!-- Describe your PR here. -->
- Loading branch information
1 parent
c136332
commit 12468e0
Showing
2 changed files
with
0 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,16 +10,6 @@ class UserRoleTest(TestCase): | |
def setUp(self) -> None: | ||
manage_default_super_admin_role() | ||
|
||
def test_permissions_for_user(self): | ||
user = self.create_user(email="[email protected]") | ||
user2 = self.create_user(email="[email protected]") | ||
role = UserRole.objects.create(name="test", permissions=["test1", "test2"]) | ||
role.users.add(user) | ||
role2 = UserRole.objects.create(name="test2", permissions=["test2", "test3"]) | ||
role2.users.add(user) | ||
assert sorted(UserRole.permissions_for_user(user.id)) == ["test1", "test2", "test3"] | ||
assert sorted(UserRole.permissions_for_user(user2.id)) == [] | ||
|
||
def test_creates_super_admin_role(self): | ||
role = UserRole.objects.get(name="Super Admin") | ||
assert sorted(role.permissions) == sorted(settings.SENTRY_USER_PERMISSIONS) |