You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
Currently, I'm trying to R&D RBAC authorization mechanism for my flask API, I read your project documentation and other RBAC implementations in a few projects, but in your project, I can't see any permissions, in RBAC implementation like K8s (rbac.authorization.k8s/v1) we assign some permissions to our specific role like watch, list and get operations on pods resources to my-test-role
and I think something like this may be good in flask...
fromenumimportEnumfromflaskimportblueprintsclassPermission(Enum):
READ="READ"CREATE="CREATE"UPDATE="UPDATE"DELETE="DELETE"classRoles(Enum):
OWNER= {Permission.CREATE,Permission.READ,Permission.UPDATE,Permission.DELETE}
ADMIN= {Permission.CREATE,Permission.READ,Permission.UPDATE}
USER= {Permission.READ}
resource=blueprints("routes",__name__)
## (User PUT request).roles = [ADMIN,USER]# |# ↓ @resource.route("/product/update",["PUT"])@rbac.allow(allow_perms={Permission.UPDATE}) # This decorator will check if the user has any role that have this permissiondefupdate_product():
pass
We assign permission to resources(in Flask API probably our routes) and permissions to roles and roles to users.
Thank you for your attention.
The text was updated successfully, but these errors were encountered:
Hi
Currently, I'm trying to R&D RBAC authorization mechanism for my flask API, I read your project documentation and other RBAC implementations in a few projects, but in your project, I can't see any permissions, in RBAC implementation like K8s (rbac.authorization.k8s/v1) we assign some permissions to our specific role like watch, list and get operations on pods resources to my-test-role
or in this RBAC implementation (repository) we can set access permissions on our roles like this:
We assign permission to resources(in Flask API probably our routes) and permissions to roles and roles to users.
Thank you for your attention.
The text was updated successfully, but these errors were encountered: