cancel
Showing results for 
Search instead for 
Did you mean: 

authenticated *IUser* object

Former Member
0 Kudos

Dear all,

i have the next question: in KM if i want to create a resource in the context of some other user (not the one who is currently loged on to the portal), how can i get an authenticated IUser object to suply for <code>new ResourceContext(IUser)</code>? (under authenticated i mean <code>IUser.isAuthenticated()</code> returns true)

It should be done with UMFactory I guess, but i could not see it through in javadoc. so, sorry if it is doble posting in this way. thanks for you help.

all the best,

ds

Accepted Solutions (1)

Accepted Solutions (1)

thilo_brandt
Employee
Employee
0 Kudos

Hi Dimitry,

there is currentyl no released API to create content for another user context. The only way you can handle this, is to store the creation user-id in a custom property and appliing a property filter for read if the created by property is requested by KM. The property filter has to replace the system created by property by your custom created by property.

Best regards,

Thilo

Message was edited by: Thilo Brandt

Former Member
0 Kudos

Thanks a lot for your reply Thilo,

I am trying to do it in this way, but keep getting ResourceException, each time I try to substitute the owner.

<code>

IProperty created_by = Property.createCreatedByProp("user");

/* ...

  • creating a resource in the context of some service

  • user)...

*/

aNewResource.setProperty(created_by);

</code>

So, I tried with <code>Property.createDisplaynameProp("disname");</code> and got the same error, so i guess i am doing something wrong.

thilo_brandt
Employee
Employee
0 Kudos

Hi Dimitry,

the CreatedBy property is a so called live property, which can only be set by the repository manager implementation.

The only possibility to handle this issue, is to store the CreatedBy information in a custom properties and appliing a Property filter for read, for every request on the CreatedBy property. The filter replaces the system CreatedBy property with your custom CreatedBy property.

Best regards,

Thilo

Former Member
0 Kudos

Thanks a lot Thilo

Answers (0)