Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » User Management APIs(Create user, List all users and change password.)
User Management APIs [message #1241089] Fri, 07 February 2014 13:15 Go to next message
Kuldeep Yadav is currently offline Kuldeep YadavFriend
Messages: 12
Registered: January 2014
Junior Member
Hi,
We are using CDO. And I have to create interface for User Administrator who will be able to add new users to system, abort existing user, change password and change roles of a user. So I want to know which APIs will actually help me. I will be grateful to you if you can pin point them. Smile
Re: User Management APIs [message #1241092 is a reply to message #1241089] Fri, 07 February 2014 13:20 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6457
Registered: July 2009
Senior Member
Am 07.02.2014 14:15, schrieb Kuldeep Yadav:
> Hi,
> We are using CDO. And I have to create interface for User Administrator who will be able to add new users to system,
> abort existing user, change password and change roles of a user. So I want to know which APIs will actually help me. I
> will be grateful to you if you can pin point them. :)
Have you already read https://wiki.eclipse.org/CDO/Security_Manager ?

Cheers
/Eike

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


Re: User Management APIs [message #1242911 is a reply to message #1241092] Mon, 10 February 2014 08:50 Go to previous messageGo to next message
Kuldeep Yadav is currently offline Kuldeep YadavFriend
Messages: 12
Registered: January 2014
Junior Member
Yes, I have read this. But I want to make web UI. So for that I want to write webservices and I need APIs.
Re: User Management APIs [message #1242947 is a reply to message #1242911] Mon, 10 February 2014 09:53 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6457
Registered: July 2009
Senior Member
Am 10.02.2014 09:50, schrieb Kuldeep Yadav:
> Yes, I have read this. But I want to make web UI. So for that I want to write webservices and I need APIs.

The API is the generated Security model on the client-side. Just call transaction.getResource("/security");

On the server you can additionally do more low-level stuff with org.eclipse.emf.cdo.server.security.ISecurityManager.
Use the Call Hierarchy to find out who else calls methods on it and how. Use this method to get at the security manager
for your repository:

org.eclipse.emf.cdo.server.security.SecurityManagerUtil.getSecurityManager(IRepository)

Cheers
/Eike

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


Re: User Management APIs [message #1243082 is a reply to message #1242947] Mon, 10 February 2014 13:47 Go to previous messageGo to next message
Kuldeep Yadav is currently offline Kuldeep YadavFriend
Messages: 12
Registered: January 2014
Junior Member
final Realm realm = (Realm) item;
realm.addUser("kavi", "kavi123");

for (final User user : realm.getAllUsers()) {
System.out.println(user.getId() + " " + user.getPassword().getEncrypted());
}


I am able to create user and password. But changes are not reflected. Even when I create user using eclipse CDO UI, I need to restart cdo server to have my changes.
So my next question is how to have my changes done without restarting.
Re: User Management APIs [message #1243117 is a reply to message #1243082] Mon, 10 February 2014 14:36 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6457
Registered: July 2009
Senior Member
Am 10.02.2014 14:47, schrieb Kuldeep Yadav:
> final Realm realm = (Realm) item;
> realm.addUser("kavi", "kavi123");
>
> for (final User user : realm.getAllUsers()) {
> System.out.println(user.getId() + " " + user.getPassword().getEncrypted());
> }
>
>
> I am able to create user and password. But changes are not reflected. Even when I create user using eclipse CDO UI, I
> need to restart cdo server to have my changes.
> So my next question is how to have my changes done without restarting.
Here you can see the changes to the security framework in CDO 4.3:
https://bugs.eclipse.org/bugs/buglist.cgi?bug_severity=enhancement&classification=Modeling&component=cdo.core&component=cdo.dawn&component=cdo.db&component=cdo.docs&component=cdo.hibernate&component=cdo.legacy&component=cdo.net4j&component=cdo.net4j.db&component=cdo.net4j.ui&component=cdo.objy&component=cdo.ui&list_id=8204169&product=EMF&query_format=advanced&resolution=FIXED&short_desc=security%20credentials&short_desc_type=anywordssubstr&version=4.3

Chances are that your problem is fixed in the 4.3 milestone builds.

Cheers
/Eike

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


Re: User Management APIs [message #1243583 is a reply to message #1243117] Tue, 11 February 2014 06:55 Go to previous messageGo to next message
Kuldeep Yadav is currently offline Kuldeep YadavFriend
Messages: 12
Registered: January 2014
Junior Member
How stable is 4.3 ? Can we use it in semi-production environment.
Re: User Management APIs [message #1243626 is a reply to message #1243583] Tue, 11 February 2014 08:09 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6457
Registered: July 2009
Senior Member
Am 11.02.2014 07:55, schrieb Kuldeep Yadav:
> How stable is 4.3 ? Can we use it in semi-production environment.
What is a semi-production environment?

All 4.3 milestone (and even the integration) builds run the same suite of ~15000 tests that's executed for releases. New
APIs might be changed or removed before the next release (unlikely, though).

Cheers
/Eike

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


Re: User Management APIs [message #1243687 is a reply to message #1243626] Tue, 11 February 2014 10:04 Go to previous messageGo to next message
Kuldeep Yadav is currently offline Kuldeep YadavFriend
Messages: 12
Registered: January 2014
Junior Member
By semi-production, I mean we are using it internally and minor issues are tolerable.
Thank you Smile
Re: User Management APIs [message #1245232 is a reply to message #1243687] Thu, 13 February 2014 13:52 Go to previous messageGo to next message
Kuldeep Yadav is currently offline Kuldeep YadavFriend
Messages: 12
Registered: January 2014
Junior Member
Hi,
User admin apis are working well in CDO 4.3.

I am able to create user and log in successfully. But while reading and setting password of already created user, it throws NoPermissionException.

org.eclipse.emf.cdo.common.security.NoPermissionException: No permission to access UserPassword@OID29:0v1
at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.checkReadable(BaseCDORevision.java:1064)
at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.getValue(BaseCDORevision.java:820)
at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.get(BaseCDORevision.java:665)
at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:190)
at org.eclipse.emf.internal.cdo.CDOObjectImpl.revisionToInstanceFeature(CDOObjectImpl.java:1342)
at org.eclipse.emf.internal.cdo.CDOObjectImpl.cdoInternalPostDetach(CDOObjectImpl.java:505)
at org.eclipse.emf.internal.cdo.view.CDOStateMachine.detach(CDOStateMachine.java:289)
at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.detached(CDOResourceImpl.java:1514)
at org.eclipse.emf.internal.cdo.CDOObjectImpl.eBasicSetContainer(CDOObjectImpl.java:793)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eInverseRemove(BasicEObjectImpl.java:1441)
at org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateSingleEObject.dynamicSet(EStructuralFeatureImpl.java:2681)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicSet(BasicEObjectImpl.java:1127)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1101)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1071)
at org.eclipse.emf.cdo.security.impl.UserImpl.setPassword(UserImpl.java:395)
at com.strandls.com.admin.CDOUserAdmin.setPassword(UserAdmin.java:189)
at com.strandls.com.admin.CDOUserAdminTest.testSetPassword(UserAdminTest.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at com.google.guiceberry.junit4.GuiceBerryRule$1.evaluate(GuiceBerryRule.java:55)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Re: User Management APIs [message #1245392 is a reply to message #1245232] Thu, 13 February 2014 18:54 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6457
Registered: July 2009
Senior Member
Am 13.02.2014 14:52, schrieb Kuldeep Yadav:
> Hi,
> User admin apis are working well in CDO 4.3.
Perfect.

> I am able to create user and log in successfully. But while reading and setting password of already created user, it
> throws NoPermissionException.
A couple days ago Christian Damus has explained how to set user passwords. Please search this forum for the thread
"[CDO] User password change with new security manager" ;-)

Cheers
/Eike

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


>
> org.eclipse.emf.cdo.common.security.NoPermissionException: No permission to access UserPassword@OID29:0v1
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.checkReadable(BaseCDORevision.java:1064)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.getValue(BaseCDORevision.java:820)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.get(BaseCDORevision.java:665)
> at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:190)
> at org.eclipse.emf.internal.cdo.CDOObjectImpl.revisionToInstanceFeature(CDOObjectImpl.java:1342)
> at org.eclipse.emf.internal.cdo.CDOObjectImpl.cdoInternalPostDetach(CDOObjectImpl.java:505)
> at org.eclipse.emf.internal.cdo.view.CDOStateMachine.detach(CDOStateMachine.java:289)
> at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.detached(CDOResourceImpl.java:1514)
> at org.eclipse.emf.internal.cdo.CDOObjectImpl.eBasicSetContainer(CDOObjectImpl.java:793)
> at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eInverseRemove(BasicEObjectImpl.java:1441)
> at
> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateSingleEObject.dynamicSet(EStructuralFeatureImpl.java:2681)
> at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicSet(BasicEObjectImpl.java:1127)
> at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1101)
> at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1071)
> at org.eclipse.emf.cdo.security.impl.UserImpl.setPassword(UserImpl.java:395)
> at com.strandls.com.admin.CDOUserAdmin.setPassword(UserAdmin.java:189)
> at com.strandls.com.admin.CDOUserAdminTest.testSetPassword(UserAdminTest.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at com.google.guiceberry.junit4.GuiceBerryRule$1.evaluate(GuiceBerryRule.java:55)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>
>


Previous Topic:[CDO?] Notifications when reference is set to 'null'
Next Topic:Call for Submission: Modeling Symposium @ EclipseCon North America 2014
Goto Forum:
  


Current Time: Thu Dec 05 22:51:37 GMT 2019

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

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

Back to the top