This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - How to display only specific items to user on main grid?

Vardhan - Monday, October 12, 2015 7:14 AM:

Hi,

We have a requirement where the parts displayed to user on main grid should be specific to manufacturer site. We have created separate Identities for the users who work at separate sites. So, users of a site1 Identity should have access to only to the parts that are being manufactured at site1.

Parts that user see on his main grid must be from his site. A property with list of sites is added to part itemtype.I can't use class path as we are already using it for 'Type'.

Is there any way to achieve this? Please help me.

Thank you, Vardh.

 



Thofste - Thursday, October 29, 2015 11:56 AM:

Hi Vardh,

We have a simulair way but we're using it to show items internally to members of a group using the team id.

We build a method and add this to the item type with an event OnBeforeAdd and OnBeforeUpdate:

//link teams to parts, docs, cads, fairs when restriction is set
//to site1 or site2 or in the future to something else
string site_var = this.getProperty("site1");
if (site_var == "Name_of_property_Site_1_from_list") //if restriction is set to Site1, only some people are allowed to view
{this.setProperty("team_id", "AAAAAAAAAAAAAAAAAAAAAAAAAA");} //Team
else //if no restriction is set, everyone may view
{this.setProperty("team_id", "24C3D41669CA4E8B96DB405D6D3FA22B");} // All employees team
return this;

You need to build a Team for each site and add the identities to the team, it can be a Alias or a group of identities.
Example All Employees Site 1, All Employees Site 2 as Identity
Example Team Site 1, Team Site 2 as Team. 

Best regards,

Tom Hofste

 

 

 



Yoann Maingon - Friday, December 18, 2015 11:26 AM:

getting deeper into the requirement, is it:

- the users must not see any part from other manufacturing sites

or

- it's more convenient if user see just their site's part on the main grid 

?

Not sure I would play too much with permissions and roles, maybe more an OnBeforeGet method which would check if the user's site matches.



Martin Fraser - Thursday, October 29, 2015 1:42 PM:

This method would only work if you have the permissions item set to team and then change the team in the code.

A simpler method would be to allow private permissions on the item. This would allow you to set permissions based on the site, which you could easily reconfigure without reprogramming the system.  You could also configure the lifecycle to grant the permission based on Promotion, and use a workflow to promote that item.

You could also allow code to modify the permissions directly.

Many thanks,
Martin



Vardhan - Tuesday, December 22, 2015 1:02 AM:

It's to make the user's search for parts more simpler. We have got Site, Division, Class and few more columns for users to dig to find their owned parts. This is taking some time. So, we wanted to filter the parts for users.

We tried Permissions, didn't work as expected, tried setting dynamic 'Default Search' values with 'OnBeforeGet', didn't work too.

Any ideas to find a better solution? Thank you.



Yoann Maingon - Tuesday, January 5, 2016 11:18 AM:

"tried setting dynamic 'Default Search' values with 'OnBeforeGet', didn't work too."

What do you mean by "didn"t work"? you didn't succeed to do it or the performances were poor?