Revision 72141255
Added by Andreas Kohlbecker over 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/occurrence/CollectionEditorPresenter.java | ||
---|---|---|
9 | 9 |
package eu.etaxonomy.cdm.vaadin.view.occurrence; |
10 | 10 |
|
11 | 11 |
import java.util.Arrays; |
12 |
import java.util.EnumSet; |
|
13 | 12 |
import java.util.List; |
14 | 13 |
|
15 | 14 |
import org.springframework.context.event.EventListener; |
16 | 15 |
|
17 | 16 |
import eu.etaxonomy.cdm.api.service.IService; |
18 | 17 |
import eu.etaxonomy.cdm.model.occurrence.Collection; |
19 |
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD; |
|
20 | 18 |
import eu.etaxonomy.cdm.service.CdmFilterablePagingProvider; |
21 | 19 |
import eu.etaxonomy.cdm.vaadin.event.CollectionEditorAction; |
22 | 20 |
import eu.etaxonomy.cdm.vaadin.event.ToOneRelatedEntityReloader; |
21 |
import eu.etaxonomy.cdm.vaadin.security.UserHelper; |
|
23 | 22 |
import eu.etaxonomy.vaadin.mvp.AbstractCdmEditorPresenter; |
24 | 23 |
import eu.etaxonomy.vaadin.ui.view.DoneWithPopupEvent; |
25 | 24 |
import eu.etaxonomy.vaadin.ui.view.DoneWithPopupEvent.Reason; |
... | ... | |
62 | 61 |
*/ |
63 | 62 |
@Override |
64 | 63 |
protected void guaranteePerEntityCRUDPermissions(Integer identifier) { |
65 |
// TODO Auto-generated method stub |
|
64 |
if(crud != null){ |
|
65 |
newAuthorityCreated = UserHelper.fromSession().createAuthorityForCurrentUser(Collection.class, identifier, crud, null); |
|
66 |
} |
|
66 | 67 |
|
67 | 68 |
} |
68 | 69 |
|
... | ... | |
71 | 72 |
*/ |
72 | 73 |
@Override |
73 | 74 |
protected void guaranteePerEntityCRUDPermissions(Collection bean) { |
74 |
// TODO Auto-generated method stub |
|
75 |
if(crud != null){ |
|
76 |
newAuthorityCreated = UserHelper.fromSession().createAuthorityForCurrentUser(bean, crud, null); |
|
77 |
} |
|
75 | 78 |
|
76 | 79 |
} |
77 | 80 |
|
... | ... | |
109 | 112 |
|
110 | 113 |
collectionPopuEditor = getNavigationManager().showInPopup(CollectionPopupEditor.class); |
111 | 114 |
|
112 |
collectionPopuEditor.grantToCurrentUser(EnumSet.of(CRUD.UPDATE, CRUD.DELETE));
|
|
115 |
collectionPopuEditor.grantToCurrentUser(this.crud);
|
|
113 | 116 |
collectionPopuEditor.withDeleteButton(true); |
114 | 117 |
collectionPopuEditor.loadInEditor(null); |
115 | 118 |
} |
... | ... | |
123 | 126 |
|
124 | 127 |
collectionPopuEditor = getNavigationManager().showInPopup(CollectionPopupEditor.class); |
125 | 128 |
|
126 |
collectionPopuEditor.grantToCurrentUser(EnumSet.of(CRUD.UPDATE, CRUD.DELETE));
|
|
129 |
collectionPopuEditor.grantToCurrentUser(this.crud);
|
|
127 | 130 |
collectionPopuEditor.withDeleteButton(true); |
128 | 131 |
collectionPopuEditor.loadInEditor(event.getEntityId()); |
129 | 132 |
} |
Also available in: Unified diff
fix #7150 fixing per entity granting of authorities for CollectionEditor