I want to add new role in CKAN. And I can do this in authz.py file. I defined a new role and give some action to the role and it worked. But i did this in baseline. I want to do this in extension. So i created new extension that named "customroles". And i copied the authz.py from "/usr/lib/ckan/default/src/ckan/ckan" to the custom folder "/usr/lib/ckan/default/src/ckanext-customroles/ckanext/customroles". Then i added new role(Super) as you can see below code.
ROLE_PERMISSIONS = OrderedDict([
('admin', ['admin']),
('editor', ['read', 'delete_dataset', 'create_dataset', 'update_dataset', 'manage_group']),
('member', ['read', 'manage_group']),
**('super', ['read', 'delete_dataset', 'create_dataset', 'manage_group']),**
])
def _trans_role_admin():
return _('Admin')
def _trans_role_editor():
return _('Editor')
def _trans_role_member():
return _('Member')
def _trans_role_super():
return _('Super')
But I couldn't see the new role while i am adding the new member in organization page. When i modify the base code, i saw the new role. But in extension it did not work.
Do i need to do anything else to modify authz.py file in extension? Do you know how can i solve this problem?
Thanks,