Can I determine the Destination Rule that was used to get to the current activity?

  • 4 November 2008
  • 3 replies
  • 0 views

Badge +1

Hi.


I'm not sure if I'm even asking the correct question here so I'll start by telling you what I would like to do.


I have Active Directory users assigned to K2 roles which are used as a destination set.  I'm using a custom worklist built in an asp.net page.  When a user views the custom worklist, I would like to change some available features of the worklist based on their role(s).  So far, I've looked with no solution at the k2 connection object and the UserRoleManagerServer to see if I could get the information.  I ended up basing it on the user's name but would like to tie it to the role instead so that, as users move in and out of the role, I don't have to change my configuration settings.  Am I missing something?


Thanks.


Paul


3 replies

Badge +9

I think at this point you can get the list of users from a role (http://www.k2underground.com/forums/thread/25772.aspx ) but there isn't a direct method to do the reverse. i.e. get list of role a user belongs to.


You probably can try enumerating the roles (http://k2underground.com/forums/post/21088.aspx) and then check if the user is a member of each role.  Would work but not very ideal from performance standpoint once the number of roles are large.


However, this might work if you have a fixed set of roles to check from.

Badge +4

This should get a list of roles a user is a member of. Just slap a web service in front of it it :-)


SELECT
  dq.Name
FROM
  _DestQueue dq
  JOIN _DestQueueUser dqu ON
    ( dq.id = dqu.queueid )
WHERE
  dqu.[user] = 'K2:DOMAINUSERNAME'

Badge +9

Just a note here.  This would only retrieve the list of roles that he is explictly specified in.


You would not be able to get the other roles where he is a member of the AD groups inside or specified in the SmartObject member list.

Reply