def accepts_admin_roles(func):
    """
    Decorator that accepts only admin roles
    :param func:
    :return:
    """
    if inspect.isclass(func):
        apply_function_to_members(func, accepts_admin_roles)
        return func
    else:
        @functools.wraps(func)
        def decorator(*args, **kwargs):
            return accepts_roles(*ROLES_ADMIN)(func)(*args, **kwargs)

        return decorator
def accepts_admin_roles ( func ) : if inspect . isclass ( func ) : apply_function_to_members ( func , accepts_admin_roles ) return func else : @ functools . wraps ( func ) def decorator ( * args , ** kwargs ) : return accepts_roles ( * ROLES_ADMIN ) ( func ) ( * args , ** kwargs ) return decorator
Decorator that accepts only admin roles
    :param func:
    :return: