Revision 0844524a
Added by Andreas Kohlbecker about 6 years ago
src/main/java/eu/etaxonomy/vaadin/mvp/AbstractCdmEditorPresenter.java | ||
---|---|---|
11 | 11 |
import java.util.Collection; |
12 | 12 |
import java.util.EnumSet; |
13 | 13 |
import java.util.HashSet; |
14 |
import java.util.UUID; |
|
14 | 15 |
|
15 | 16 |
import org.apache.log4j.Logger; |
16 | 17 |
import org.hibernate.HibernateException; |
... | ... | |
75 | 76 |
|
76 | 77 |
DTO cdmEntitiy; |
77 | 78 |
if(identifier != null) { |
78 |
Integer integerID = (Integer)identifier;
|
|
79 |
UUID uuidIdentifier = (UUID)identifier;
|
|
79 | 80 |
// CdmAuthority is needed before the bean is loaded into the session. |
80 | 81 |
// otherwise adding the authority to the user would cause a flush |
81 |
guaranteePerEntityCRUDPermissions(integerID);
|
|
82 |
cdmEntitiy = loadCdmEntityById(integerID);
|
|
82 |
guaranteePerEntityCRUDPermissions(uuidIdentifier);
|
|
83 |
cdmEntitiy = loadCdmEntity(uuidIdentifier);
|
|
83 | 84 |
} else { |
84 |
cdmEntitiy = loadCdmEntityById(null);
|
|
85 |
cdmEntitiy = loadCdmEntity(null); |
|
85 | 86 |
if(cdmEntitiy != null){ |
86 | 87 |
guaranteePerEntityCRUDPermissions(cdmEntitiy); |
87 | 88 |
} |
... | ... | |
101 | 102 |
* @param identifier |
102 | 103 |
* @return |
103 | 104 |
*/ |
104 |
protected abstract DTO loadCdmEntityById(Integer identifier);
|
|
105 |
protected abstract DTO loadCdmEntity(UUID uuid);
|
|
105 | 106 |
|
106 | 107 |
/** |
107 | 108 |
* Grant per entity CdmAuthority to the current user <b>for the bean which is not yet loaded</b> |
108 | 109 |
* into the editor. The <code>CRUD</code> to be granted are stored in the <code>crud</code> field. |
109 | 110 |
*/ |
110 |
protected abstract void guaranteePerEntityCRUDPermissions(Integer identifier);
|
|
111 |
protected abstract void guaranteePerEntityCRUDPermissions(UUID identifier);
|
|
111 | 112 |
|
112 | 113 |
/** |
113 | 114 |
* Grant per entity CdmAuthority to the current user for the bean which is loaded |
Also available in: Unified diff
switching vom id based to uuid based ui navigation and entity references