Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Champion Listener
kwill
Posts: 26
Country: Canada
Message 1 of 3 (606 Views)
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?

Please use plain text.
Bronze Super Contributor
vivek
Posts: 1,817
Country: United_Kingdom
Message 2 of 3 (587 Views)

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
Please use plain text.
Champion Listener
kwill
Posts: 26
Country: Canada
Message 3 of 3 (566 Views)

Re: Accessing team members list

Worked brilliantly. Thanks.
Please use plain text.