Beispiel #1
0
def has_role(instance, *args, **kwargs):
    '''
        Applies the roles %{args} to your class instance.

        %{instance} must be a class instance object.
        %{args} must be a list of class objects, not instantiated classes.

        Example:

        has_role(self, RoleClass)

        has_role(self, RoleClass, OtherRoleClass)


    '''
    meta = MetaRole()
    meta.apply(instance, *args, **kwargs)
Beispiel #2
0
def has_role(instance, *args, **kwargs):
    '''
        Applies the roles %{args} to your class instance.

        %{instance} must be a class instance object.
        %{args} must be a list of class objects, not instantiated classes.

        Example:

        has_role(self, RoleClass)

        has_role(self, RoleClass, OtherRoleClass)


    '''
    meta = MetaRole()
    meta.apply(instance, *args, **kwargs)