Users with multiple roles?

S

sodell

I'm somewhat familiar with the new roles functionality in SP1 now, and I
understand that the order in which they are defined matters, because IP
apparently stops at the first matching role for a given user and assumes
that is their current role.

Can someone show me some JScript code that can determine if the current user
belongs to a given IP-defined (not AD-defined) role? (a function, perhaps,
that takes the name of the role as it is defined in the IP form, and returns
true or false if the current user is assigned to it?)

Maybe I'm overlooking something really simple here -- I hope I am.

One other (totally nonrelated) question: If I'm not using VS.NET 2003 to
develop my forms, and am only using IP with the MS Script Editor, should I
expect to see Intellisense?

Thanks!

-- Stacy
 
P

Patrick Halstead

Hi Stacy,

I just got done writing about this scenario for our upcoming MS Learning
book on Developming Solutions With InfoPath. One simple way to do this is
using a secondary data source that defines a contact as <Name, Alias
(DOMAIN\username), E-mail address> for the users in the roles. Create
multiple role elements with repeating contacts. You can then use the
built-in role support to query the secondary data source on load. Or, you
can create your own function to search through the secondary data source for
a match. In the latter case, you'll need to get the DOMAIN and username for
the currently logged in user. There are a bunch of ways to do this. One of
the MSDN labs uses Environment.Username, but that won't work for users who
are not logged in to the domain and are VPN'ing in. I have some code I could
send you, but I'd like to understand your scenario better first.

I don't believe MSE has Intellisense.

Patrick Halstead
InfoPath MVP
"Developing Solutions with InfoPath"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top