Assign roles - reg

Kindly help me with this scenario.

Scenario: I have two employees 'A' and 'B' under a manager 'X'. X assigns a module to 'A' and 'B'. .

I have a folder called 'Projects' . I have a multiple choice field that contains the list of employees. I am selecting 'A' first and 'B' second from the list. Once the page is created selected members will be assigned the role of 'tech_team'. When I log in as 'A' or 'B' I must be able to view the 'Project' folder but the folder is visible only for the last selected person.

Note: No error is displaying.

Code Snippet:


<field name="assigned_to" type="zope.schema.Set">
      <title>Assigned To</title>
      <value_type type="zope.schema.Choice">

Retrives all the employee.

Assign Roles:

for member in self.context.assigned_to:
			if not role in api.user.get_roles(username=str(user),obj=self.context):
				self.context.plone_log('disabled for Sub Project')
				self.context.plone_log('Disabled for main Project')
				self.context.plone_log('roles granted for sub project')
				self.context.plone_log('roles granted for project')

Assigns tech_team roles to the employee in the list. This gives the view and access content information feature to that particular set of employees.

Retriving the project list (Sub Project)

		for brain in subProject:
		return subProjectList

I am able to retrieve the projects except for the projects that are assigned to multiple employees.

Kindly help me...:slight_smile:

At least


make little sense...why don't you use



Look (in the ZMI) in portal_catalog -> Contents for an object that does not show up. It will show you all indexed values for the particular content object...check why the values don't match with the's either the path aka context or the portal_type. In addition you have to be aware that a search query returns only content visible and accessible for the current user.

Kindly reply to my actual problem . I have changed the above code but didn't update here. Thank you.

I clearly responded to your problem and I clearly pointed you how debug this catalog query issue.

No bro thats not the problem I changed it to self.context

Please, learn reading answers.

Ooh .. thank you for the suggestions

Please stop being a sorehead.

Your question was "I am able to retrieve the projects except for the projects that are assigned to multiple employees."

The related code here and key to your problem is that the catalog query does not return what you want.

And I gave you clear instructions how to investigate yourself based on your data and your installation.

So come up with facts instead of smashing us with code and configuration that we can hardly verify ourselves with a reasonable amount of time.