(name)
return _wrap
A decorator for views which required a user to be member
    to a particular group.
A decorator for views which required a user to be member
    to a particular group.
A decorator for views which required a user to be member to a particular group .
def group_required(name):
    """
    A decorator for views which required a user to be member
    to a particular group.
    """
    def _wrap(f):
        @wraps(f)
        def _wrapped(*args, **kwargs):
            if g.user is None or not g.user.in_group(name):
                return redirect(url_for('account.login'))
            return f(*args, **kwargs)
        return _wrapped
    return _wrap
def group_required ( name ) : def _wrap ( f ) : @ wraps ( f ) def _wrapped ( * args , * * kwargs ) : if g . user is None or not g . user . in_group ( name ) : return redirect ( url_for ( 'account.login' ) ) return f ( * args , * * kwargs ) return _wrapped return _wrap