Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Comparing Historical revisions: No Permission
[CDO] Comparing Historical revisions: No Permission [message #1690842] Tue, 31 March 2015 14:48 Go to next message
Samuel Leisering is currently offline Samuel LeiseringFriend
Messages: 34
Registered: July 2014
Member
Hi
I have a question regarding the CDO-Compare API.
I opened a CDO-Object in the History View of the eclipse Team-UI with the command:
TeamUI.showHistoryFor(workbenchPage, cdoObject, CDOHistoryPageSource.INSTANCE);


i tried to compare the commits that appear using the org.eclipse.emf.cdo.ui.compare plugin, and the context menu of the history view.

I encountered the following problem: If i compare commits that happened before i started the current session, i get the following exception:

org.eclipse.emf.cdo.common.security.NoPermissionException: No permission to access MyObject@OID69:0v10
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.checkReadable(BaseCDORevision.java:1114)
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.getValue(BaseCDORevision.java:854)
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.get(BaseCDORevision.java:669)
	at org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl.compare(CDORevisionDeltaImpl.java:463)
	at org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl.<init>(CDORevisionDeltaImpl.java:119)
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.compare(BaseCDORevision.java:602)
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.compare(BaseCDORevision.java:1)
	at org.eclipse.emf.cdo.common.revision.CDORevisionUtil.createChangeSetData(CDORevisionUtil.java:268)
	at org.eclipse.emf.cdo.common.revision.CDORevisionUtil.createChangeSetData(CDORevisionUtil.java:229)
	at org.eclipse.emf.internal.cdo.session.CDOSessionImpl.compareRevisions(CDOSessionImpl.java:1142)
	at org.eclipse.emf.internal.cdo.view.AbstractCDOView.compareRevisions(AbstractCDOView.java:1820)
	at org.eclipse.emf.cdo.compare.CDOComparisonScope$Minimal.getAffectedIDs(CDOComparisonScope.java:319)
	at org.eclipse.emf.cdo.compare.CDOComparisonScope$Minimal.create(CDOComparisonScope.java:287)
	at org.eclipse.emf.cdo.compare.CDOCompareUtil.compare(CDOCompareUtil.java:94)
	at org.eclipse.emf.cdo.ui.compare.CDOCompareEditorUtil.openDialog(CDOCompareEditorUtil.java:84)
	at org.eclipse.emf.cdo.ui.compare.CDOCompareEditorUtil.openDialog(CDOCompareEditorUtil.java:53)
	at org.eclipse.emf.cdo.ui.compare.CDOCompareEditorUtil.openDialog(CDOCompareEditorUtil.java:67)
	at org.eclipse.emf.cdo.ui.compare.CDOCompareEditorUtil.openDialog(CDOCompareEditorUtil.java:79)
	at org.eclipse.emf.cdo.ui.internal.compare.CompareWithPreviousVersionAction.run(CompareWithPreviousVersionAction.java:36)
	at org.eclipse.emf.cdo.ui.internal.compare.AbstractAction.run(AbstractAction.java:75)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:253)
	...


To clarify: I should have the permission to read the object, especially since i did the commits i wanted to compare myself.

it works when i compare commits that happened while my session was already open.

The CDO-Server runs with a SecurityManager, no branch support and of course audit support.

Greetings,
Samuel Leisering
Re: [CDO] Comparing Historical revisions: No Permission [message #1690846 is a reply to message #1690842] Tue, 31 March 2015 15:05 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Samuel,

I'm not 100% sure whether it's related to your problem but I seem to recall that SecurityManager plus a client with
multiple different views to the repository (as in auditing or branching) doesn't (and can't) work. The reason is that
the permission of an object is computed in the context of such a view but the result is stored in its revision. And that
is shared with other views (in which a different permission would have been applied). I thought we have a guard against
this, but I don't recall where it was. Perhaps I accidentally just excluded branching but permitted auditing...

If you really need this combination of functionality you may be successful by using different CDOSessions (with one view
each, then). But I'm not sure, so you will have to play a little bit. If it happens that you'd need new API on the
cdo.compare level please submit a bugzilla.

Cheers
/Eike

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



Am 31.03.2015 um 16:48 schrieb Samuel Leisering:
> Hi
> I have a question regarding the CDO-Compare API.
> I opened a CDO-Object in the History View of the eclipse Team-UI with the command:
> TeamUI.showHistoryFor(workbenchPage, cdoObject, CDOHistoryPageSource.INSTANCE);
>
> i tried to compare the commits that appear using the org.eclipse.emf.cdo.ui.compare plugin, and the context menu of
> the history view.
>
> I encountered the following problem: If i compare commits that happened before i started the current session, i get
> the following exception:
>
>
> org.eclipse.emf.cdo.common.security.NoPermissionException: No permission to access MyObject@OID69:0v10
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.checkReadable(BaseCDORevision.java:1114)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.getValue(BaseCDORevision.java:854)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.get(BaseCDORevision.java:669)
> at org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl.compare(CDORevisionDeltaImpl.java:463)
> at org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl.<init>(CDORevisionDeltaImpl.java:119)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.compare(BaseCDORevision.java:602)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.compare(BaseCDORevision.java:1)
> at org.eclipse.emf.cdo.common.revision.CDORevisionUtil.createChangeSetData(CDORevisionUtil.java:268)
> at org.eclipse.emf.cdo.common.revision.CDORevisionUtil.createChangeSetData(CDORevisionUtil.java:229)
> at org.eclipse.emf.internal.cdo.session.CDOSessionImpl.compareRevisions(CDOSessionImpl.java:1142)
> at org.eclipse.emf.internal.cdo.view.AbstractCDOView.compareRevisions(AbstractCDOView.java:1820)
> at org.eclipse.emf.cdo.compare.CDOComparisonScope$Minimal.getAffectedIDs(CDOComparisonScope.java:319)
> at org.eclipse.emf.cdo.compare.CDOComparisonScope$Minimal.create(CDOComparisonScope.java:287)
> at org.eclipse.emf.cdo.compare.CDOCompareUtil.compare(CDOCompareUtil.java:94)
> at org.eclipse.emf.cdo.ui.compare.CDOCompareEditorUtil.openDialog(CDOCompareEditorUtil.java:84)
> at org.eclipse.emf.cdo.ui.compare.CDOCompareEditorUtil.openDialog(CDOCompareEditorUtil.java:53)
> at org.eclipse.emf.cdo.ui.compare.CDOCompareEditorUtil.openDialog(CDOCompareEditorUtil.java:67)
> at org.eclipse.emf.cdo.ui.compare.CDOCompareEditorUtil.openDialog(CDOCompareEditorUtil.java:79)
> at
> org.eclipse.emf.cdo.ui.internal.compare.CompareWithPreviousVersionAction.run(CompareWithPreviousVersionAction.java:36)
> at org.eclipse.emf.cdo.ui.internal.compare.AbstractAction.run(AbstractAction.java:75)
> at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:253)
> ...
>
>
> To clarify: I should have the permission to read the object, especially since i did the commits i wanted to compare
> myself.
>
> it works when i compare commits that happened while my session was already open.
>
> The CDO-Server runs with a SecurityManager, no branch support and of course audit support.
>
> Greetings,
> Samuel Leisering


Re: [CDO] Comparing Historical revisions: No Permission [message #1690851 is a reply to message #1690842] Tue, 31 March 2015 15:26 Go to previous messageGo to next message
Ashish Shinde is currently offline Ashish ShindeFriend
Messages: 21
Registered: August 2013
Junior Member
Looks like this is the same as the issue I faced some time back. I have sort of posted an analysis for this issues and a potential fix, however there has been no action on this post.

Hope this gets fixed.


Re: [CDO] Comparing Historical revisions: No Permission [message #1690934 is a reply to message #1690851] Wed, 01 April 2015 05:26 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 31.03.2015 um 17:26 schrieb Ashish Shinde:
> Looks like this is the same as the https://www.eclipse.org/forums/index.php/m/1307551/#msg_1307551 I faced some time
> back. I have sort of posted an analysis for this issues and a potential fix, however there has been no action on this
> post.
Thank you for your analysis. The main problem is really a flaw in CDO's permission design, which was introduced together
with org.eclipse.emf.cdo.security.ObjectFilter and org.eclipse.emf.cdo.security.ObjectPermission. In short, objects, as
opposed to revisions, logically exist in object graphs that are (externally) discriminatedby a view branch point. The
entire revision layer doesn't know this concept. The "securityContext" parameter in many revision-level methods is an
attempt to compensate this, so it must behave similar to a view branch point, i.e., not change during a query.

> Hope this gets fixed.
A good fix would probably move the (client-side) caching of permissions from the revisions to the objects (the eFlags
could be used). Even though the server doesn't deal with objects directly (only with revisions) it already has a similar
mechanism in place. This all sounds like more than a week of effort ;-(

Cheers
/Eike

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


Previous Topic:[CDO] Converting existing code to use CDO and the transaction API
Next Topic:Best strategy to use for &lt;XML -&gt; Custom-EMF model&gt;
Goto Forum:
  


Current Time: Fri Apr 19 11:57:24 GMT 2024

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

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

Back to the top