can_perform(required, granted) where both arguments are iterables of permission strings. Return True only if every required permission is included in the granted ones. An empty required always returns True.can_perform(['read', 'write'], ['read', 'write', 'delete'])
True
Both required permissions are granted.
can_perform(['admin'], ['read', 'write'])
False
admin is missing.
Convert both to sets.
The <= operator tests "is subset of".