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
But how I can use this function to media endpoint.
Because it only works when I set the role in ALLOWED_READ_ROLES, it doesn't work if only set on ALLOWED_ITEM_READ_ROLES, which is security risk.
I'm trying to modify the auth.py file and I add some logic for media endpoint like this below in requires_auth function: elif endpoint_class == "media": resource_name = resource = None public = app.config["PUBLIC_METHODS"] + ["OPTIONS"] roles = list(app.config["ALLOWED_ROLES"]) if request.method in ["GET", "OPTIONS"]: roles += app.config["ALLOWED_READ_ROLES_MEDIA"] auth = app.auth
And it works well, is it okay ?
Thank you.
The text was updated successfully, but these errors were encountered:
Hello, I'm using Role Based Access Control
But how I can use this function to media endpoint.
Because it only works when I set the role in ALLOWED_READ_ROLES, it doesn't work if only set on ALLOWED_ITEM_READ_ROLES, which is security risk.
I'm trying to modify the auth.py file and I add some logic for media endpoint like this below in requires_auth function:
elif endpoint_class == "media":
resource_name = resource = None
public = app.config["PUBLIC_METHODS"] + ["OPTIONS"]
roles = list(app.config["ALLOWED_ROLES"])
if request.method in ["GET", "OPTIONS"]:
roles += app.config["ALLOWED_READ_ROLES_MEDIA"]
auth = app.auth
And it works well, is it okay ?
Thank you.
The text was updated successfully, but these errors were encountered: