@Test public void testCanCreate_enabled() { when(authorizationManager.authorize(any(ResourceRef.class), eq(ResourceAction.READ), eq(user))).thenReturn(true); assertTrue(tested.canCreate()); }
@Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(CaseManagementDiagramEditor.EDITOR_ID, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); }
CaseManagementDiagramNewResourceHandler extends AbstractProjectDiagramNewResourceHandler<CaseManagementDiagramResourceType> { @Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(CaseManagementDiagramEditor.EDITOR_ID, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); } }
CaseManagementDiagramNewResourceHandler extends AbstractProjectDiagramNewResourceHandler<CaseManagementDiagramResourceType> { @Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(CaseManagementDiagramEditor.EDITOR_ID, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); } protected  CaseManagementDiagramNewResourceHandler(); @Inject  CaseManagementDiagramNewResourceHandler(final DefinitionManager definitionManager,
                                                   final ClientProjectDiagramService projectDiagramServices,
                                                   final BusyIndicatorView indicatorView,
                                                   final CaseManagementDiagramResourceType projectDiagramResourceType,
                                                   final AuthorizationManager authorizationManager,
                                                   final SessionInfo sessionInfo,
                                                   final CaseHelper caseHelper); }
CaseManagementDiagramNewResourceHandler extends AbstractProjectDiagramNewResourceHandler<CaseManagementDiagramResourceType> { @Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(CaseManagementDiagramEditor.EDITOR_ID, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); } protected  CaseManagementDiagramNewResourceHandler(); @Inject  CaseManagementDiagramNewResourceHandler(final DefinitionManager definitionManager,
                                                   final ClientProjectDiagramService projectDiagramServices,
                                                   final BusyIndicatorView indicatorView,
                                                   final CaseManagementDiagramResourceType projectDiagramResourceType,
                                                   final AuthorizationManager authorizationManager,
                                                   final SessionInfo sessionInfo,
                                                   final CaseHelper caseHelper); @Override String getDescription(); @Override IsWidget getIcon(); @Override boolean canCreate(); @Override List<Profile> getProfiles(); @Override void createDiagram(Package pkg, String name, NewResourcePresenter presenter, Path path, String setId,
                              String moduleName, Optional<String> projectType); @Override void acceptContext(Callback<Boolean, Void> callback); }
CaseManagementDiagramNewResourceHandler extends AbstractProjectDiagramNewResourceHandler<CaseManagementDiagramResourceType> { @Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(CaseManagementDiagramEditor.EDITOR_ID, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); } protected  CaseManagementDiagramNewResourceHandler(); @Inject  CaseManagementDiagramNewResourceHandler(final DefinitionManager definitionManager,
                                                   final ClientProjectDiagramService projectDiagramServices,
                                                   final BusyIndicatorView indicatorView,
                                                   final CaseManagementDiagramResourceType projectDiagramResourceType,
                                                   final AuthorizationManager authorizationManager,
                                                   final SessionInfo sessionInfo,
                                                   final CaseHelper caseHelper); @Override String getDescription(); @Override IsWidget getIcon(); @Override boolean canCreate(); @Override List<Profile> getProfiles(); @Override void createDiagram(Package pkg, String name, NewResourcePresenter presenter, Path path, String setId,
                              String moduleName, Optional<String> projectType); @Override void acceptContext(Callback<Boolean, Void> callback);  }