add rules for any authenticated user (with a sessionId) in python

17 views
Skip to first unread message

c.felder.m.sc

unread,
Aug 22, 2012, 9:38:28 AM8/22/12
to icatproje...@googlegroups.com

Hello,


I want to create rules for any authenticated user (with a sessionId) as mentioned in the ICAT Java Client User Manual

and I want to do it in python.


Corresponding to the following java code (from manual):


            Rule rule = new Rule(); 
            rule.setGroup(null); // Not necessary as it will be null on a newly created rule 
            rule.setCrudFlags("R"); 
            rule.setWhat("ParameterType"); 
            icat.create(sessionId, rule);


I have written the following python code (client is a suds.client instance connected to my ICAT web service):


            rule = self._c.factory.create("rule")

            rule.group = None

            rule.crudFlags = "R"

            rule.what = "ParameterType"

            client.service.create(sessionId, rule)


The rule will be added to the service but it has no effect on any authenticated user.

If I create an own group 'user', create the same rule referencing this group and put any user

in this group it works, but it would be nice to have a set of default rules for any user so

I have not to add any new user to ICAT and to this group 'user'.


Thanks for any help.


Best

Christian

Reply all
Reply to author
Forward
0 new messages