[ckan-discuss] Creating new roles

Sean Hammond sean.hammond at okfn.org
Wed Feb 29 11:10:48 GMT 2012


On 02/29/2012 09:37 AM, Ruben Martin wrote:
> Hi all again.
>
> Docs 1.5.1 mentions the possibility of creating new roles in addition
> to the defaults. But i dont see any paster command to do that, nor any
> web administration page. So can i do that?
>
> The objective would be to have the datasets in a site divided into
> groups. Just users of a specific authorization group would have
> permissions to add/edit datasets in the respective group.
>
> But when we i try to do something similar to this:
> paster --plugin=ckan roles allow newroleX create-package read read-site
> paster --plugin=ckan rights make agroup:agroupX newroleX group:groupX
>
> I get the error:
> AssertionError: Role newroleX does not exist: anon_editor, admin, editor, reader
>
> Thank you
>

Hi again Ruben,

I'm only now learning about CKAN roles myself, but lets see if we an 
figure this out.

If you second command (paster rights make ...) is telling you that 
newroleX doesn't exist then I'm guessing your first command (paster 
roles allow ...) didn't work. If you run `paster --plugin=ckan roles 
list`, what output do you get? Does it list your newroleX role?

Assuming that the newroleX role has not been created:

When I try your `paster roles allow ...` command I get an error because 
it has too many arguments. Try doing them one by one:

paster --plugin=ckan roles allow newroleX create-package
paster --plugin=ckan roles allow newroleX read
paster --plugin=ckan roles allow newroleX read-site

Then do `paster --plugin=ckan roles list` again to check if it worked.
-- 
http://seanh.sdfeu.org/



More information about the ckan-discuss mailing list