Exemplo n.º 1
0
def include(package, file=None):
    """
    include is different from scan. Include is for including a regular zcml
    include
    """
    register_configuration(caller_module(), dict(package=package, file=file),
                           'include')
Exemplo n.º 2
0
def grant(principal=None, role=None, permission=None, permissions=None):
    register_configuration(
        caller_module(),
        dict(principal=principal,
             role=role,
             permission=permission,
             permissions=permissions), 'grant')
Exemplo n.º 3
0
def grant_all(principal=None, role=None):
    register_configuration(
        caller_module(),
        dict(
            principal=principal,
            role=role),
        'grant_all')
Exemplo n.º 4
0
 def __call__(self, klass=None):
     if klass is None:
         if 'factory' not in self.config:
             raise Exception('Must provide factory configuration when defining '
                             'without a class')
         klass = caller_module()
     return super(_factory_decorator, self).__call__(klass)
Exemplo n.º 5
0
 def __call__(self, klass=None):
     if klass is None:
         if 'factory' not in self.config:
             raise Exception(
                 'Must provide factory configuration when defining '
                 'without a class')
         klass = caller_module()
     return super(_factory_decorator, self).__call__(klass)
Exemplo n.º 6
0
def permission(id, title, description=''):
    register_configuration(
        caller_module(),
        dict(
            id=id,
            title=title,
            description=description),
        'permission')
Exemplo n.º 7
0
def include(package, file=None):
    """
    include is different from scan. Include is for including a regular zcml
    include
    """
    register_configuration(
        caller_module(),
        dict(package=package, file=file),
        'include')
Exemplo n.º 8
0
def role(id, title, description='', local=True):
    register_configuration(
        caller_module(),
        dict(
            id=id,
            title=title,
            description=description,
            local=local),
        'role')
Exemplo n.º 9
0
def grant(principal=None, role=None, permission=None,
          permissions=None):
    register_configuration(
        caller_module(),
        dict(
            principal=principal,
            role=role,
            permission=permission,
            permissions=permissions),
        'grant')
Exemplo n.º 10
0
def grant_all(principal=None, role=None):
    register_configuration(caller_module(), dict(principal=principal,
                                                 role=role), 'grant_all')
Exemplo n.º 11
0
def role(id, title, description=''):
    register_configuration(caller_module(),
                           dict(id=id, title=title, description=description),
                           'role')
Exemplo n.º 12
0
def permission(id, title, description=''):
    register_configuration(caller_module(),
                           dict(id=id, title=title, description=description),
                           'permission')