def get_roles(self): try: if current_user.is_superuser(): return super().get_roles() except AttributeError: pass user_roles = current_user.get_roles() roles = super().get_roles() return { key: list(set(values) & set(user_roles)) for key, values in roles.items() }
def is_accessible(self): return ( not AUTHENTICATE or (not current_user.is_anonymous() and current_user.is_superuser()) )
def is_accessible(self): return (not AUTHENTICATE or (not current_user.is_anonymous and current_user.is_superuser()))
def endpoints(self): if current_user.is_superuser(): return super().endpoints() user_roles = current_user.get_roles() endpoints = super().endpoints() return self._filter(endpoints, user_roles)
def is_superuser(): return current_user.is_superuser()
def wrapper(*args, **kwargs): if not current_user.is_superuser(): abort(401) return func(*args, **kwargs)
def is_accessible(self): return not current_user.is_anonymous() and current_user.is_superuser()