Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [cdo] Embedded CDO server
[cdo] Embedded CDO server [message #1151196] Wed, 23 October 2013 07:28 Go to next message
saurav singh is currently offline saurav singhFriend
Messages: 21
Registered: August 2013
Junior Member
We have embedded CDO server with security manager configured. If I am not wrong then by default Administrator doesn't have Resource Tree Writer , All Object Writer roles assigned.
How can we assign more roles to Administrator using API only.
Re: [cdo] Embedded CDO server [message #1151876 is a reply to message #1151196] Wed, 23 October 2013 17:11 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6457
Registered: July 2009
Senior Member
Am 23.10.2013 09:28, schrieb saurav singh:
> We have embedded CDO server with security manager configured. If I am not wrong then by default Administrator doesn't
> have Resource Tree Writer , All Object Writer roles assigned.
> How can we assign more roles to Administrator using API only.
Something like this should do the trick:

ISecurityManager securityManager = SecurityManagerUtil.getSecurityManager(repository);
securityManager.modify(new RealmOperation()
{
public void execute(Realm realm)
{
// Modify the realm here
}
});

Note that all realm modifications happen under the identity of ISecurityManager.SYSTEM_USER_ID.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [cdo] Embedded CDO server [message #1152684 is a reply to message #1151876] Thu, 24 October 2013 05:40 Go to previous message
saurav singh is currently offline saurav singhFriend
Messages: 21
Registered: August 2013
Junior Member
Thanks Eike .. it worked

securityManager.modify(new RealmOperation() {
@Override
public void execute(final Realm realm) {
realm.getUser("Administrator").getRoles()
.add(realm.getRole("Resource Tree Writer"));
realm.getUser("Administrator").getRoles().add(realm.getRole("All Objects Writer"));
}
});
Previous Topic:[CDO]cdo - master of how your code to run in eclipse?thank you!
Next Topic:Performance of Intrinsic Vs Extrinsic ID
Goto Forum:
  


Current Time: Sun Dec 08 15:43:19 GMT 2019

Powered by FUDForum. Page generated in 0.06807 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top