Revision 55ecdf3a
Added by Andreas Kohlbecker over 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationEditorPresenter.java | ||
---|---|---|
13 | 13 |
import eu.etaxonomy.cdm.model.common.User; |
14 | 14 |
import eu.etaxonomy.cdm.model.name.Registration; |
15 | 15 |
import eu.etaxonomy.cdm.vaadin.component.CdmBeanItemContainerFactory; |
16 |
import eu.etaxonomy.cdm.vaadin.security.UserHelper; |
|
16 | 17 |
import eu.etaxonomy.vaadin.mvp.AbstractCdmEditorPresenter; |
17 | 18 |
|
18 | 19 |
/** |
... | ... | |
36 | 37 |
* {@inheritDoc} |
37 | 38 |
*/ |
38 | 39 |
@Override |
39 |
protected Registration loadBeanById(Object identifier) {
|
|
40 |
protected Registration loadCdmEntityById(Integer identifier) {
|
|
40 | 41 |
|
41 | 42 |
Registration reg; |
42 | 43 |
if(identifier != null){ |
43 |
reg = getRepo().getRegistrationService().find((Integer)identifier);
|
|
44 |
reg = getRepo().getRegistrationService().find(identifier); |
|
44 | 45 |
} else { |
45 | 46 |
reg = Registration.NewInstance(); |
46 | 47 |
} |
47 | 48 |
return reg; |
48 | 49 |
} |
49 | 50 |
|
51 |
/** |
|
52 |
* {@inheritDoc} |
|
53 |
*/ |
|
54 |
@Override |
|
55 |
protected void guaranteePerEntityCRUDPermissions(Integer identifier) { |
|
56 |
if(crud != null){ |
|
57 |
newAuthorityCreated = UserHelper.fromSession().createAuthorityForCurrentUser(Registration.class, identifier, crud, null); |
|
58 |
} |
|
59 |
|
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* {@inheritDoc} |
|
64 |
*/ |
|
65 |
@Override |
|
66 |
protected void guaranteePerEntityCRUDPermissions(Registration bean) { |
|
67 |
if(crud != null){ |
|
68 |
newAuthorityCreated = UserHelper.fromSession().createAuthorityForCurrentUser(bean, crud, null); |
|
69 |
} |
|
70 |
} |
|
71 |
|
|
50 | 72 |
/** |
51 | 73 |
* {@inheritDoc} |
52 | 74 |
*/ |
Also available in: Unified diff
ref #6867 generic failsave mechanism to grant per entity permission in CdmPopupEditors