Retrieving employee data under manager

Hello everyone, I am new to mendix and If one manager login into the application and his department is named ‘xyz’ then he should be able to see all the employee list under the department ‘xyz’. i have created a microflow for this, but its not working. Could anyone please suggest me on this.   Thanks in Advance.
1 answers

Hi Apurupa, it all starts with your domainmodel. Once that is set up correctly, you hardly need a microflow to show a list of the department-employees to the department-manager.

So your domain model is probably something like this:

  • A manager is an employee having the userrole Departmentmanager and the association with the position of Manager at department XYZ
  • One or more employees have the userrole StaffMember and the association with the position of Staff at department XYZ

An employee is a person having the userrole she fullfills in the company. So one of the 2 userroles mentioned here: DepartmentManager and DepartmentStaff.

If you define the userroles in a way that the DepartmentManager can read (part of) the Employees (users having userroleDepartmentStaff) of the department she manages, you can drop in a dataview of a Department with a list of its employee and then the manager will only get to see what she is allowed to see.