forked from ome/openmicroscopy
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ticket:1781 - Fixing issues with exp/grp update ('''API CHANGE!''')
For implementation reasons, we are changing the contract of the IAdmin "update*" methods to only respect the string changes on the objects, and not all the links for now. git-svn-id: file:///home/svn/omero/trunk@6066 05709c45-44f0-0310-885b-81a1db45b4a6
- Loading branch information
Showing
5 changed files
with
142 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
components/server/src/ome/tools/hibernate/SecureMerge.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* Copyright 2009 Glencoe Software, Inc. All rights reserved. | ||
* Use is subject to license terms supplied in LICENSE.txt | ||
*/ | ||
|
||
package ome.tools.hibernate; | ||
|
||
import ome.model.IObject; | ||
import ome.security.SecureAction; | ||
import ome.security.auth.SimpleRoleProvider; | ||
|
||
import org.hibernate.Session; | ||
|
||
/** | ||
* Helper originally from {@link SimpleRoleProvider} for merging admin objects. | ||
* | ||
* @author Josh Moore, josh at glencoesoftware.com | ||
* @since 4.0 | ||
* | ||
*/ | ||
public class SecureMerge implements SecureAction { | ||
|
||
private final Session session; | ||
|
||
public SecureMerge(Session session) { | ||
this.session = session; | ||
} | ||
|
||
public <T extends IObject> T updateObject(T... objs) { | ||
return (T) session.merge(objs[0]); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters