forked from CGM_Public/pretix_original
s/WhiteList/AllowList/g
This commit is contained in:
@@ -9,18 +9,18 @@ class FullAccessSecurityProfile:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class WhiteListSecurityProfile:
|
class AllowListSecurityProfile:
|
||||||
whitelist = tuple()
|
allowlist = tuple()
|
||||||
|
|
||||||
def is_allowed(self, request):
|
def is_allowed(self, request):
|
||||||
key = (request.method, f"{request.resolver_match.namespace}:{request.resolver_match.url_name}")
|
key = (request.method, f"{request.resolver_match.namespace}:{request.resolver_match.url_name}")
|
||||||
return key in self.whitelist
|
return key in self.allowlist
|
||||||
|
|
||||||
|
|
||||||
class PretixScanSecurityProfile(WhiteListSecurityProfile):
|
class PretixScanSecurityProfile(AllowListSecurityProfile):
|
||||||
identifier = 'pretixscan'
|
identifier = 'pretixscan'
|
||||||
verbose_name = _('pretixSCAN')
|
verbose_name = _('pretixSCAN')
|
||||||
whitelist = (
|
allowlist = (
|
||||||
('GET', 'api-v1:version'),
|
('GET', 'api-v1:version'),
|
||||||
('GET', 'api-v1:device.update'),
|
('GET', 'api-v1:device.update'),
|
||||||
('GET', 'api-v1:device.revoke'),
|
('GET', 'api-v1:device.revoke'),
|
||||||
@@ -42,10 +42,10 @@ class PretixScanSecurityProfile(WhiteListSecurityProfile):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class PretixScanNoSyncSecurityProfile(WhiteListSecurityProfile):
|
class PretixScanNoSyncSecurityProfile(AllowListSecurityProfile):
|
||||||
identifier = 'pretixscan_online_kiosk'
|
identifier = 'pretixscan_online_kiosk'
|
||||||
verbose_name = _('pretixSCAN (kiosk mode, online only)')
|
verbose_name = _('pretixSCAN (kiosk mode, online only)')
|
||||||
whitelist = (
|
allowlist = (
|
||||||
('GET', 'api-v1:version'),
|
('GET', 'api-v1:version'),
|
||||||
('GET', 'api-v1:device.update'),
|
('GET', 'api-v1:device.update'),
|
||||||
('GET', 'api-v1:device.revoke'),
|
('GET', 'api-v1:device.revoke'),
|
||||||
@@ -65,10 +65,10 @@ class PretixScanNoSyncSecurityProfile(WhiteListSecurityProfile):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class PretixPosSecurityProfile(WhiteListSecurityProfile):
|
class PretixPosSecurityProfile(AllowListSecurityProfile):
|
||||||
identifier = 'pretixpos'
|
identifier = 'pretixpos'
|
||||||
verbose_name = _('pretixPOS')
|
verbose_name = _('pretixPOS')
|
||||||
whitelist = (
|
allowlist = (
|
||||||
('GET', 'api-v1:version'),
|
('GET', 'api-v1:version'),
|
||||||
('GET', 'api-v1:device.update'),
|
('GET', 'api-v1:device.update'),
|
||||||
('GET', 'api-v1:device.revoke'),
|
('GET', 'api-v1:device.revoke'),
|
||||||
|
|||||||
Reference in New Issue
Block a user