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
File details
Details for the file ckanext_permissions-0.0.1.tar.gz
.
File metadata
- Download URL: ckanext_permissions-0.0.1.tar.gz
- Upload date:
- Size: 28.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0073e48f8b3f9f6c1e7738896cf0b379515d461d0eee6b8b8d999219ac5bcee0 |
|
MD5 | 9e5284a86bf84cbd4a3c33be298722ea |
|
BLAKE2b-256 | 56151ac5d846dc019ff3b48abca228e668a1aa3c972a7edb050d4fed4d9b5705 |
File details
Details for the file ckanext_permissions-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: ckanext_permissions-0.0.1-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b754f9e61c8fb4ccf1a0693f212beee429bccfca7824f2bd23c45def8ba5caa |
|
MD5 | 1ce41e790d766a862feaa5094d80020b |
|
BLAKE2b-256 | c23e933e4e0691fd00202cad4fa86609f09414ec0f160d63623834dae4e22316 |