librelist archives

« back to archive

Authenticate user against Blueprints?

Authenticate user against Blueprints?

From:
est
Date:
2011-12-14 @ 05:36
Hi list,

If I have a blueprint with url_prefix '/admin'

Is it possible to force all views under this blueprint have to login to a
specific group of user first?

What's the general approach for access control with Flask blueprints?

TIA.

est

Re: [flask] Authenticate user against Blueprints?

From:
Sean Lynch
Date:
2011-12-14 @ 13:23
Take a look at this snippet and see if it's what you're looking for -
http://flask.pocoo.org/snippets/59/

On Wed, Dec 14, 2011 at 12:36 AM, est <electronixtar@gmail.com> wrote:

> Hi list,
>
> If I have a blueprint with url_prefix '/admin'
>
> Is it possible to force all views under this blueprint have to login to a
> specific group of user first?
>
> What's the general approach for access control with Flask blueprints?
>
> TIA.
>
> est
>

Re: [flask] Authenticate user against Blueprints?

From:
est
Date:
2011-12-15 @ 02:32
Thanks guys, the snippet works very well.

On Wed, Dec 14, 2011 at 9:23 PM, Sean Lynch <techniq35@gmail.com> wrote:

> Take a look at this snippet and see if it's what you're looking for -
> http://flask.pocoo.org/snippets/59/
>
>
> On Wed, Dec 14, 2011 at 12:36 AM, est <electronixtar@gmail.com> wrote:
>
>> Hi list,
>>
>> If I have a blueprint with url_prefix '/admin'
>>
>> Is it possible to force all views under this blueprint have to login to a
>> specific group of user first?
>>
>> What's the general approach for access control with Flask blueprints?
>>
>> TIA.
>>
>> est
>>
>
>

Re: [flask] Authenticate user against Blueprints?

From:
kracekumar ramaraju
Date:
2011-12-14 @ 13:49
Hi
 I am currently developing YAML based static page generator. You can have a
look at it https://github.com/kracekumar/Blaze.

It uses two blueprints one for admin and other for normal users.

Then admin part is incomplete but login works, I use decorator
@login_required.

Feel free to ask any questions about the working.

Note: admin code is not documented properly but other blueprint code is
well documented.

Thanks & Regards
Kracekumar
"Talk is cheap, show me the code" -- Linus Torvalds.