Eric,

I tried to google what I want to do, but I never was able to find what I
was looking for.  That's why I posted here.

Joshua,

The code you posted is close to what I am looking for.  Here are the tweeks
that need to be addressed:
This code is in an app.py and want to route the user.  I am currently using
the line

    return redirect(url_for('principal'))

    and the function principal has two decorators:

        @app.route('/principal')
        @principal_required(user_object)
        def principal(user_id, school_id)


I'll post more specifics tonight.


On Tue, Aug 19, 2014 at 9:47 PM, Joshua Elliott <[email protected]> wrote:

> On Tue, Aug 19, 2014 at 9:05 PM, Daniel <[email protected]> wrote:
>
> > I have a flask application I am writing. I need to know how to pass a
> > variable to the decorator of a function. The decorator will determine if
> a
> > user is authorized to view a page. The variable I would use would have
> the
> > user id and role. Can anyone help with this?
> >
>
> Here's an example that does something like you're talking about:
>
> https://gist.github.com/jcelliott/ec23ef0948dbc834e5bb
>
> /*
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
> */
>

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to