api: make enforce() static
It doesn't use 'self'. And pylint complains.
This commit is contained in:
parent
db6094f397
commit
3740e2d48b
@ -196,7 +196,8 @@ class AbstractQubesAPI(object):
|
|||||||
return apply_filters(iterable,
|
return apply_filters(iterable,
|
||||||
self.fire_event_for_permission(**kwargs))
|
self.fire_event_for_permission(**kwargs))
|
||||||
|
|
||||||
def enforce(self, predicate):
|
@staticmethod
|
||||||
|
def enforce(predicate):
|
||||||
'''An assert replacement, but works even with optimisations.'''
|
'''An assert replacement, but works even with optimisations.'''
|
||||||
if not predicate:
|
if not predicate:
|
||||||
raise PermissionDenied()
|
raise PermissionDenied()
|
||||||
|
Loading…
Reference in New Issue
Block a user