[kronolith] Calendar permissions via xmlrpc / python

Jan Schneider jan at horde.org
Tue Jan 29 11:38:58 UTC 2013


Zitat von Guenter Bartsch <guenter.bartsch at gmail.com>:

> jan,
>
> On Tue, Jan 29, 2013 at 11:01 AM, Jan Schneider <jan at horde.org> wrote:
>>> print "horde: Browse..."
>>>
>>> browse = server.calendar.browse ("kronolith/%s" % horde_login, [])
>>>
>>> for cal_id in browse:
>>>
>>>         try:
>>>                 if cal_id.endswith (".ics"):
>>>                         continue
>>>
>>>                 cal = browse[cal_id]
>>>                 print "horde:   %s: %s" % (cal_id, str(cal))
>>>
>>>                 base_id = cal_id.rsplit ('/', 1)[1]
>>>
>>>                 perms = server.horde.listUserPermissions ("kronolith",
>>> base_id, horde_login)
>>>
>>>                 print "horde:    result from listUserPermissions: %s"
>>> % str(perms)
>>>
>>>                 for perm in perms:
>>>                         print "horde:     UP %s" % str(perm)
>>>
>>>                 perms = server.horde.listGroupPermissions
>>> ("kronolith", base_id, horde_login)
>>>
>>>                 print "horde:    result from listGroupPermissions: %s"
>>> % str(perms)
>>>
>>>                 for perm in perms:
>>>                         print "horde:     GP %s" % str(perm)
>>>
>>>         except xmlrpclib.Fault as e:
>>>                 print "Fault catched: %s" % e
>>>
>>> ideas, anyone?
>>>
>>> best,
>>>
>>>    guenter
>>
>>
>> Those methods will only list explicit permissions, not implicit permissions.
>
> not sure what implicit and explicit permissions are? are all the
> permissions I set using the web gui implicit?

No, the opposite. Explicit permissions are those set in the GUI.  
Implicit are permissions defined by a user role, e.g. of  
administrators or share owners.

> I have created a test calendar and set lots of permissions on it, see
> attached screenshot. but still:
>
> horde: Browse...
> horde:   kronolith/heiko/vzIvbK9GdIOq7PEPgu3otg1: {'browseable': True,
> 'name': 'Events from Shared Kalender von Heiko', 'icon': {'': [],
> 'app': 'kronolith'}}
> horde:    result from listUserPermissions: []
> horde:    result from listGroupPermissions: []
>
> best,
>
>    guenter

And did you actually request the permission for one of those users? In  
your script you use horde_login as the 3rd parameter, which, I assume,  
is the owner of the calendar that your are querying.
-- 
Jan Schneider
The Horde Project
http://www.horde.org/



More information about the kronolith mailing list