1
1
from django .conf import settings
2
- from django .utils import timezone
3
2
4
3
from sentry import features
5
- from sentry .data_secrecy .service .service import data_secrecy_service
6
4
from sentry .models .organization import Organization
7
5
from sentry .organizations .services .organization import RpcOrganization , RpcUserOrganizationContext
8
6
@@ -11,7 +9,7 @@ def should_allow_superuser_access(
11
9
organization_context : Organization | RpcUserOrganizationContext ,
12
10
) -> bool :
13
11
14
- # If self hosted installation, superuser access is allowed
12
+ # If self hosted installation, allow superuser access
15
13
if settings .SENTRY_SELF_HOSTED :
16
14
return True
17
15
@@ -21,19 +19,13 @@ def should_allow_superuser_access(
21
19
else :
22
20
organization = organization_context
23
21
24
- # If organization does not have data-secrecy feature, return True
22
+ # If organization does not have data-secrecy feature, allow superuser access
25
23
if not features .has ("organizations:data-secrecy" , organization ):
26
24
return True
27
25
28
- # If organization's prevent_superuser_access bitflag is False, return True
26
+ # If organization's prevent_superuser_access bitflag is False, allow superuser access
29
27
if not organization .flags .prevent_superuser_access :
30
28
return True
31
29
32
- ds = data_secrecy_service .get_data_secrecy_waiver (organization_id = organization .id )
33
-
34
- # If no data secrecy waiver exists, data secrecy is active
35
- if ds is None :
36
- return False
37
-
38
- # If current time is before the access_end time of the waiver, data secrecy is active
39
- return timezone .now () <= ds .access_end
30
+ # If organization has data-secrecy feature, but prevent_superuser_access is True, prevent superuser access
31
+ return False
0 commit comments