Revision 0844524a
Added by Andreas Kohlbecker about 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/security/PermissionDebugUtils.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
import java.io.Serializable; |
12 | 12 |
import java.util.EnumSet; |
13 |
import java.util.UUID; |
|
13 | 14 |
|
14 | 15 |
import org.apache.log4j.Logger; |
15 | 16 |
import org.springframework.context.annotation.Profile; |
... | ... | |
65 | 66 |
} |
66 | 67 |
|
67 | 68 |
public static Button addGainPerEntityPermissionButton(AbstractComponentContainer toContainer, Class<? extends CdmBase> cdmType, |
68 |
Integer entitiyId, EnumSet<CRUD> crud, String property){
|
|
69 |
UUID entitiyUuid, EnumSet<CRUD> crud, String property){
|
|
69 | 70 |
|
70 | 71 |
PermissionDebugUtils pu = PermissionDebugUtils.fromSession(); |
71 | 72 |
if(pu != null){ |
72 |
Button button = pu.gainPerEntityPermissionButton(cdmType, entitiyId, crud, property);
|
|
73 |
Button button = pu.gainPerEntityPermissionButton(cdmType, entitiyUuid, crud, property);
|
|
73 | 74 |
if(button != null){ |
74 | 75 |
toContainer.addComponent(button); |
75 | 76 |
} |
... | ... | |
78 | 79 |
return null; |
79 | 80 |
} |
80 | 81 |
|
81 |
public Button gainPerEntityPermissionButton(Class<? extends CdmBase> cdmType, Integer entitiyId, EnumSet<CRUD> crud, String property){
|
|
82 |
public Button gainPerEntityPermissionButton(Class<? extends CdmBase> cdmType, UUID entitiyUuid, EnumSet<CRUD> crud, String property){
|
|
82 | 83 |
|
83 | 84 |
Button button = new Button(FontAwesome.BOLT); |
84 |
button.addClickListener(e -> UserHelper.fromSession().createAuthorityFor(UserHelper.fromSession().userName(), cdmType, entitiyId, crud, property));
|
|
85 |
button.addClickListener(e -> UserHelper.fromSession().createAuthorityFor(UserHelper.fromSession().userName(), cdmType, entitiyUuid, crud, property));
|
|
85 | 86 |
button.addStyleName(ValoTheme.BUTTON_DANGER); |
86 | 87 |
return button; |
87 | 88 |
|
Also available in: Unified diff
switching vom id based to uuid based ui navigation and entity references