[Zope-CMF] Permission/ownership problem
Luca Olivetti
luca@wetron.es
Fri, 22 Mar 2002 12:57:29 +0100
Hi,
I have:
- A custom CMF object, say myObject, which 'edit' method is protected by..
- A custom permission, say myPermission
- A DCworkflow, which in a transition calls a method that changes ownership (and local
roles) of the object. The permission 'myPermission' is granted only to the 'Owner' and
'Dept Manager'
I created an object, gone through the workflow until the stage that I changed ownership
of the object.
When I go see the object as the new user, all is weel, i.e. the new user has the
permission to edit the object, the correct actions appear in the actions box, etc.
The problem is that the CMF still thinks I'm the Owner of the object, since I have the
same actions listed and working.
If I check the management interface, the object has myPermission assigned to 'Owner' and
'Dept Manager', the ownership is of the other user and the only local role is 'Owner'
for the other user. If I remove myPermission for Owner I cannot see the actions, so I
think that the CMF still thinks I'm the owner.
I used this to change the permission in myObject:
def assignTo(self, user_id):
acl_users = self.portal_membership.acl_users
user = acl_users.getUser(user_id).__of__(acl_users)
self.changeOwnership(user)
self.manage_delLocalRoles([ user for user,roles in self.get_local_roles() ])
self.manage_setLocalRoles(user_id, ['Owner'])
Does the CMF look somewhere else (not visible from the management interface) for roles?
TIA
--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004 Fax +34 93 5883007