New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_action is a confusing interface, let's improve it #3254
Comments
How about friendly calls with keyword arguments and auto-detected file objects, ckan.logic.request_action(action_name, **data_dict)
ckan.logic.sysadmin_action(action_name, **data_dict)
ckan.logic.anonymous_action(action_name, **data_dict)
ckan.logic.user_action(username, action_name, **data_dict)
|
what about just having the permission level as an argument instead?
Actually, might also make sense to change it to |
@jrods then we can't have users named 'sysadmin', 'anonymous' or 'request' :-) In general I don't like mixing different types of arguments in the same parameters to avoid surprising bugs like that. |
Fair enough, I would have then suggested only taking an userobj instead of username, making it, pretty trivial to check, but then i don't know if there would be problems in the instance of when an userobj wouldn't be available. It makes sense to have dedicated functions to specific authorization levels, but what about extensions that expand/create user roles different from core? Would extensions just sort of be self contained in that regard, managing non-default permissions within itself? I don't know what the current situation is like and what other extension do, so I would like to be enlighten, if it's worth being concerned about. |
I don't think this list can actually grow. Other than |
We decided to close old issues that are not actively worked on so that we can focus our effort and attention on issues affecting the current versions of CKAN. If this issue is still affecting the version of CKAN you're working with now, please feel free to comment or reopen the issue. If you do reopen this issue, please update it with new details. One reason it might not have been resolved in the past is that it wasn't clear how a contributor could address the issue. |
current patterns in ckan
examples from ckanapi (not necesarily ideal)
The text was updated successfully, but these errors were encountered: