Skip to content
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

Add config setting to let local Organization admin users set Public/Private #2

Open
reedv opened this issue Mar 26, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@reedv
Copy link
Owner

reedv commented Mar 26, 2021

Ie. a config setting like..

#ckanext.publicrestrictiondatasets.allowed_users = sysadmin
ckanext.publicrestrictiondatasets.allowed_users = admin

to let users decide if they want sysadmins or local Organization admins (in addition to sysadmins) to have control over dataset visibility (rather than only admins).

@reedv reedv added the enhancement New feature or request label Mar 26, 2021
@reedv
Copy link
Owner Author

reedv commented Mar 26, 2021

see https://docs.ckan.org/en/2.9/extensions/plugins-toolkit.html#ckan.plugins.toolkit.ckan.plugins.toolkit.config on how to access the ckan.ini configs.

eg...

ALLOWED_ACCESS_LEVELS = ['sysadmin', 'admin']
access_level = toolkit.config.get("ckanext.publicrestrictiondatasets.allowed_users")
assert access_level in ALLOWED_ACCESS_LEVELS
.
.
.
if access_level is 'sysadmin':
    <do stuff>
else if access_level is 'admin':
    <do stuff>
else:
    <raise some error>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant