Project

General

Profile

« Previous | Next » 

Revision 3cc5bf8b

Added by Andreas Kohlbecker over 6 years ago

fixing ReferenceEditorAction problems

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java
191 191
        ReferenceEditorAction referenceEditorAction = null;
192 192
        if(workingSet.getCitationId() != null){
193 193
            if(UserHelper.fromSession().userHasPermission(Reference.class, workingSet.getCitationId(), CRUD.UPDATE)){
194
                referenceEditorAction = new ReferenceEditorAction(EditorActionType.EDIT, workingSet.getCitationId());
194
                referenceEditorAction = new ReferenceEditorAction(EditorActionType.EDIT, workingSet.getCitationId(), null, parentView);
195 195
            }
196 196
            PermissionDebugUtils.addGainPerEntityPermissionButton(this, Reference.class, workingSet.getCitationId(), EnumSet.of(CRUD.UPDATE, CRUD.DELETE), null);
197 197
        } else {
198
            if(UserHelper.fromSession().userHasPermission(Reference.class, CRUD.CREATE)){
198
            if(UserHelper.fromSession().userHasPermission(Reference.class, CRUD.CREATE, null, null, parentView)){
199 199
                referenceEditorAction = new ReferenceEditorAction(EditorActionType.ADD);
200 200
            }
201 201
        }
src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPresenter.java
178 178
    }
179 179

  
180 180
    protected boolean checkFromOwnView(AbstractEditorAction event) {
181
        return getView() == event.getSourceView();
181
        return getView() != null && getView() == event.getSourceView();
182 182
    }
183 183

  
184 184
}

Also available in: Unified diff