Setting Up Team Leader / Member Permissions in Time Cockpit

Monday, July 14, 2014 by Rainer Stropek

A common scenario in time cockpit is assigning different permissions to team leaders and team members. Team leaders should see all time sheet records of all members whereas team members should only see their own records. In this blog post you learn how you can set up this logic in time cockpit within a few minutes.

Requirement

This is the scenario that I want to implement in this blog post:

  1. Time cockpit supports assigning users to departments out of the box. We want to add the possibility to assign 0...n team leaders for each department.
  2. Every user can only see and edit her own time sheet records.
  3. In addition to (2), team leaders can see (not edit) time sheet records of all members in their team (=department).

Note that we reuse the existing department table in this blog post. You could create a separate team table if you want.

Video Step-by-Step Tutorial

Checklist

  1. Create a new entity (=table) to store team leader assignments. It has a relation to APP_Department and APP_UserDetail.

Don't forget to limit access permissions to the new table as shown in the video above. Otherwise everbody could remove you time sheet permissions by changing team leader assignments.


  1. Optionally create a custom UI (list, form) for departments so you can edit department members and team leaders directly in the department form.
    1. Create a new form for APP_Department.
    2. Create a new list for APP_Department.
    3. Set the new form and list as the new UI for the APP_Department entity.
  2. Create a set containing all departments that the current user is leader of. Here is the TCQL statement that is shown in the video above:
From D In TeamLeader
Where D.TeamLeaderUser.UserDetailUuid = Environment.CurrentUser.UserDetailUuid
Select New With { D.Department.Code }
  1. Define the read/write permissions in the APP_Timesheet entity. Here is the TCQL expression that is shown in the video for the write permission:
Current.UserDetail.UserDetailUuid = Environment.CurrentUser.UserDetailUuid
 Or Current.UserDetail.Department.Code In Set('DepartmentsLedByMe', 'Code')
 Or 'Admin' In Set('CurrentUserRoles', 'Code')

Questions

In case of questions contact us at support@timecockpit.com.

comments powered by Disqus

Rainer Stropek

Rainer Stropek

Co-founder, architect, developer

Bio

I am co-founder and CEO of the company software architects and have been serving this role since 2008. At software architects my team and I are developing the award-winning SaaS solution time cockpit. Previously, I founded and led IT consulting firms that worked in the area of developing software solutions based on the Microsoft technology stack.

In my work I focus on .NET development and software architecture. I have written some books and articles on C#, database development, Windows Azure, Windows 8 development, WPF, and Silverlight. Regularly I speak at conferences, do workshops and conduct trainings in Europe and the US. Since 2010 I have been MVP for Windows Azure.

I graduated the Higher Technical School Leonding (AT) for MIS with honors and hold a BSc (Hons) Computer Studies of the University of Derby (UK).

Contact

Twitter: @rstropek
Facebook
Google+
Xing
LinkedIn

Authors