Eventhandler

M

Martin Winzig

I'm not able impersonate user in onPublished event handler, because the
contextInfo cannot be used to impersonate user!!
 
G

Guidho

Based on the user info that you can retrieve from contextinfo, you should be
able to retrieve all information for this resource to build the impersonation
context.
Unfortunately, I don't have a code sample on how to do this...
 
B

Bryant Likes

Martin Winzig said:
I'm not able impersonate user in onPublished event handler, because the
contextInfo cannot be used to impersonate user!!

What are you trying to do that requires impersonation? You do have the user
info as Guidho says, so you should be able to filter or do whatever by the
user id.
 
M

Martin Winzig

I know how to impersonate user. :eek:)

Problem is that there is a bug, and parameter contextInfo contains
informations which can't be used to impersonate user. Prom on published
eventhandler
 
B

Bryant Likes

Martin Winzig said:
I know how to impersonate user. :eek:)

Problem is that there is a bug, and parameter contextInfo contains
informations which can't be used to impersonate user. Prom on published
eventhandler

I'm sure you do. :)

What is the bug you're referring to? Is the user name incorrect?

Let me know.
 
M

Martin Winzig

isWindowsUser==false for domain users.

==========================

Everytime I try do develop st important there is same bug, which causing
that I'm not able develop what i need for example when i created event
handler which synchronizing permission on project workspace i discovered that
build in synchronization cannot be disabled :(
And when i try excalate bug to premier support average fit time is 9 month
:) or they told me that this is a feature :(

http://www.projectserver.cz
 
B

Bryant Likes

Martin Winzig said:
isWindowsUser==false for domain users.

I'm sure you've tried this, but should this just be a check to see if the
user name starts with a domain name?

So
isWindowsUser = contextInfo.UserName.Contains("\\");

Does that work? I've never checked that property but all my domain users
include the domain name in the username.
 
M

Martin Winzig

I'm using alternative formula :)

isWindowsUser = !contextInfo.UserName.Contains(":");
 
M

Martin Winzig

--
Blog: http://www.projectserver.cz


Bryant Likes said:
Looks like Brian Smith is reading this group:

http://blogs.msdn.com/brismith/arch...ct-server-2007-server-side-event-handler.aspx

How about posting here as well Brian? :)
Unfortunately brian didn't used my class which using reflection to get SSP
URL, i know that this is unsuported but it's much more better than his
aproach.

http://projectserver.cz/cms/index.php?itemid=35

by the way do you no how to impersonate user from WSS event handler itere is
one amaizing object in *.PWA.DLL PJCONTEXT

public override void ItemUpdated(SPItemEventProperties properties)
{

PJContext.Reset();
PJContext.GetContext(properties, s);


PJContext.Current.PSI.PWAWebService.ProjectUpdateProposalState(_projectUid,
ProposalListModerationStatus.Approved);

unfortunately GetContext method is protected :)

public override void ItemUpdated(SPItemEventProperties properties)

{
......
PJContext.Reset();
MethodInfo mInfo = typeof(PJContext).GetMethod(
"GetContext",
BindingFlags.Instance | BindingFlags.NonPublic |
BindingFlags.Static,
null,
new Type[2] { typeof(SPItemEventProperties), typeof(string) },
null);
mInfo.Invoke(null,new object[2]{properties, s });

Microsoft.Office.Project.Server.Schema.ProjectDataSet
myProjectDataset = PJContext.Current.PSI.ProjectWebService.ReadProjectList();
 

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