Showing results for 
Search instead for 
Do you mean 
Reply

Accessing team members list

Accepted Solution Solved
Highlighted
Copper Contributor
Posts: 28
Country: Canada
Accepted Solution

Accessing team members list

Currently, I have code where the list of users is hard coded. (i.e. if CurrentUser = User1 or User2 then enable x else disable it).  However, given the constantly changing nature of permissions, etc. I would like to have a more dynamic list and have thereby created a team "Team1".  I am ta aloss of how to programmatically access said team though.  I need something that does

 

If CurrentUser Is Team1Member then

 

How exactly can I got about grabbing the team list?


Accepted Solutions
Solution
Accepted by topic author kwill
‎09-25-2015 03:20 AM
Bronze Elite Contributor
Posts: 2,085
Country: United_Kingdom

Re: Accessing team members list

Your best bet would be via the TeamManager:

 

 

ActFramework oFram;
User u = oFram.CurrentUser;

Team[] teams = oFram.Teams.Teams;
foreach(Team t in teams){
   if(t.Name=="My Team" && t.ContainsUser(u)){
       doStuff();
   }
}

 I haven't tested this code but hopefully it should do the trick.

 

HTH,

 

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog

View solution in original post


All Replies
Solution
Accepted by topic author kwill
‎09-25-2015 03:20 AM
Bronze Elite Contributor
Posts: 2,085
Country: United_Kingdom

Re: Accessing team members list

Your best bet would be via the TeamManager:

 

 

ActFramework oFram;
User u = oFram.CurrentUser;

Team[] teams = oFram.Teams.Teams;
foreach(Team t in teams){
   if(t.Name=="My Team" && t.ContainsUser(u)){
       doStuff();
   }
}

 I haven't tested this code but hopefully it should do the trick.

 

HTH,

 

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Copper Contributor
Posts: 28
Country: Canada

Re: Accessing team members list

Worked brilliantly. Thanks.