If you are going to create roles and add users to this then why not just add Users to the Company group anyway and publish to those Company groups.
So have you got Departments (Customers) across companies, ie you have SALES and holds multiple customer users or do you have SALES (CO 1), SALES (CO 2) etc, ie one per customer. Departments can be linked to cost centres etc or other company specific info.
If you do have separate customers then you can public to them directly.
I normally have a trigger on the DB that as the Primary Group field is set (normally with Company name) it also adds to the group as well.
Thank you very much for your answer!
I have a large structure with hierarchy of departments. For examle: Company1\Department1\Subdepartment1\... and so on\DepartmentN\User1, Company2\....\DepartmentM\UserK/
I use this structure for KPI (incidents from department), for automatic incident assignment, for SLM, for Knowledge Domains, for cost centers and so on.
As result I can not use the Company as current group or as the primary group of the user.
But as I understand it is enough to include the user to the company group and this user can see the services of this company. Unfortunately in the documentation there is no detailed description: for what group is service shall be published:
- for any group that the user is a member
- for user's current group
- or/and for user's primary group
Unfortunately in any case the tSQL script is needed.