@Test public void checkCanCreateWhenFeatureEnabled() { when(authorizationManager.authorize(any(ResourceRef.class), eq(ResourceAction.READ), eq(user))).thenReturn(true); assertTrue(handler.canCreate()); assertResourceRef(); }
@Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(BPMNDiagramEditor.EDITOR_ID, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); }
BPMNDiagramNewResourceHandler extends AbstractProjectDiagramNewResourceHandler<BPMNDiagramResourceType> { @Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(BPMNDiagramEditor.EDITOR_ID, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); } }
BPMNDiagramNewResourceHandler extends AbstractProjectDiagramNewResourceHandler<BPMNDiagramResourceType> { @Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(BPMNDiagramEditor.EDITOR_ID, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); } protected  BPMNDiagramNewResourceHandler(); @Inject  BPMNDiagramNewResourceHandler(final DefinitionManager definitionManager,
                                         final ClientProjectDiagramService projectDiagramServices,
                                         final BusyIndicatorView indicatorView,
                                         final BPMNDiagramResourceType projectDiagramResourceType,
                                         final AuthorizationManager authorizationManager,
                                         final SessionInfo sessionInfo); }
BPMNDiagramNewResourceHandler extends AbstractProjectDiagramNewResourceHandler<BPMNDiagramResourceType> { @Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(BPMNDiagramEditor.EDITOR_ID, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); } protected  BPMNDiagramNewResourceHandler(); @Inject  BPMNDiagramNewResourceHandler(final DefinitionManager definitionManager,
                                         final ClientProjectDiagramService projectDiagramServices,
                                         final BusyIndicatorView indicatorView,
                                         final BPMNDiagramResourceType projectDiagramResourceType,
                                         final AuthorizationManager authorizationManager,
                                         final SessionInfo sessionInfo); @Override String getDescription(); @Override IsWidget getIcon(); @Override boolean canCreate(); }
BPMNDiagramNewResourceHandler extends AbstractProjectDiagramNewResourceHandler<BPMNDiagramResourceType> { @Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(BPMNDiagramEditor.EDITOR_ID, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); } protected  BPMNDiagramNewResourceHandler(); @Inject  BPMNDiagramNewResourceHandler(final DefinitionManager definitionManager,
                                         final ClientProjectDiagramService projectDiagramServices,
                                         final BusyIndicatorView indicatorView,
                                         final BPMNDiagramResourceType projectDiagramResourceType,
                                         final AuthorizationManager authorizationManager,
                                         final SessionInfo sessionInfo); @Override String getDescription(); @Override IsWidget getIcon(); @Override boolean canCreate();  }