Introduce 'has_subscription' role with 'can-renew-subscription' capability

This is in preparation of presenting different messages to users, when their
subscription should be renewed, or when they should buy a (new)
subscription.
This commit is contained in:
2017-11-30 15:30:08 +01:00
parent efc18c5628
commit 5d281dc6ce

View File

@@ -12,8 +12,12 @@ ROLES_TO_BE_SUBSCRIBER = {'demo', 'subscriber', 'admin'} # TODO: get rid of thi
class CloudExtension(PillarExtension):
has_context_processor = True
user_roles = {'subscriber-pro'}
user_roles_indexable = {'subscriber-pro'}
user_roles = {'subscriber-pro', 'has_subscription'}
user_roles_indexable = {'subscriber-pro', 'has_subscription'}
user_caps = {
'has_subscription': {'can-renew-subscription'},
}
def __init__(self):
self._log = logging.getLogger('%s.CloudExtension' % __name__)