Permission system for CKAN
Project description
ckanext-permissions
The extension allows you to build a permission system within CKAN. For now, it uses
3 default roles: anonymous, user and sysadmin. We plan to expand the functionallity to
allow registering context roles, like organisation admin
, editor
or member
.
Or even create a custom role and assign it to user to apply specific checks. For example,
create a role moderator
and allow those users to delete comments
in ckanext-comments
extension.
This feature is experimental. For now it requires alteration in CKAN core to work.
diff --git a/ckan/logic/__init__.py b/ckan/logic/__init__.py
index 18ccd59e4..62da81720 100644
--- a/ckan/logic/__init__.py
+++ b/ckan/logic/__init__.py
@@ -365,6 +365,10 @@ def check_access(action: str,
authorized to call the named action
'''
+ from ckanext.permissions.utils import check_access as perm_check_access
+
+ if perm_check_access(action, context, data_dict):
+ return True
# Auth Auditing. We remove this call from the __auth_audit stack to show
# we have called the auth function
Requirements
Compatibility with core CKAN versions:
CKAN version | Compatible? |
---|---|
2.7 and earlier | no |
2.8 | no |
2.9 | no |
2.10+ | yes |
Installation
Install it from pypi
(TBD) or from source if you know what you are doing. Refer to CKAN
documentation to know, how to install extension from source.
Config settings
TBD
Tests
We have tests so if you are changing something, ensure that they are not broken. To run the tests, do:
pytest --ckan-ini=test.ini
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ckanext_permissions-0.0.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0166cb7f304debbd1e13319d7febf15395b489872efc2a654a0ec0148534d4a |
|
MD5 | db018d6fc6c58775f07c60149943cc40 |
|
BLAKE2b-256 | 5b95ce9c84d56aaecd9e7042a6752435c9c6e31c6df72c8675dc461389a67e88 |
Hashes for ckanext_permissions-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f57544889fef2a48a292ff4fb5ddbe02bcf6598456773da7bb8b959f4774720a |
|
MD5 | a7f026c6a3ae4450ca320c92ccf19f18 |
|
BLAKE2b-256 | 3a0173f7256cf5a6ab8fdf6c815224d0587276b2cb269aa7bf623ad7b8e64f3d |