Closed kr4600 closed 1 year ago
Yes this looks like a reasonable change to make, I will take a look at adding support for this feature.
Now supported in version 1.5.0, you can use the decorator as follows:
@auth_required(groups=["admin", "editor"], any_group=True)
Hi, I'm trying to manage access to flask resources to specific groups assigned in cognito. I have several roles that i'd like to give access to things that they really need.
For example: Admin page:
Editor page:
I've tried to add multiple groups into
auth_required
but it haven't worked out, because there'sall()
operator inside. https://github.com/mblackgeo/flask-cognito-lib/blob/c493f071cb58ce122429842d969735bcb1b4d53c/src/flask_cognito_lib/decorators.py#L174Is it possible to add flag
any=True
toauth_required
for that use case? Or should i completely change my approach to this problem?