@Test public void checkCanCreateWhenFeatureDisabled() { when(authorizationManager.authorize(any(ResourceRef.class), eq(ResourceAction.READ), eq(user))).thenReturn(false); assertFalse(handler.canCreate()); assertResourceRef(); }
@Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(EditorIds.GUIDED_SCORE_CARD, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); }
NewGuidedScoreCardHandler extends DefaultNewResourceHandler { @Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(EditorIds.GUIDED_SCORE_CARD, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); } }
NewGuidedScoreCardHandler extends DefaultNewResourceHandler { @Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(EditorIds.GUIDED_SCORE_CARD, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); } NewGuidedScoreCardHandler(); @Inject  NewGuidedScoreCardHandler(final Caller<GuidedScoreCardEditorService> scoreCardService,
                                     final GuidedScoreCardResourceType resourceType,
                                     final BusyIndicatorView busyIndicatorView,
                                     final AuthorizationManager authorizationManager,
                                     final SessionInfo sessionInfo); }
NewGuidedScoreCardHandler extends DefaultNewResourceHandler { @Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(EditorIds.GUIDED_SCORE_CARD, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); } NewGuidedScoreCardHandler(); @Inject  NewGuidedScoreCardHandler(final Caller<GuidedScoreCardEditorService> scoreCardService,
                                     final GuidedScoreCardResourceType resourceType,
                                     final BusyIndicatorView busyIndicatorView,
                                     final AuthorizationManager authorizationManager,
                                     final SessionInfo sessionInfo); @Override String getDescription(); @Override IsWidget getIcon(); @Override ResourceTypeDefinition getResourceType(); @Override boolean canCreate(); @Override void create(final Package pkg,
                       final String baseFileName,
                       final NewResourcePresenter presenter); }
NewGuidedScoreCardHandler extends DefaultNewResourceHandler { @Override public boolean canCreate() { return authorizationManager.authorize(new ResourceRef(EditorIds.GUIDED_SCORE_CARD, ActivityResourceType.EDITOR), ResourceAction.READ, sessionInfo.getIdentity()); } NewGuidedScoreCardHandler(); @Inject  NewGuidedScoreCardHandler(final Caller<GuidedScoreCardEditorService> scoreCardService,
                                     final GuidedScoreCardResourceType resourceType,
                                     final BusyIndicatorView busyIndicatorView,
                                     final AuthorizationManager authorizationManager,
                                     final SessionInfo sessionInfo); @Override String getDescription(); @Override IsWidget getIcon(); @Override ResourceTypeDefinition getResourceType(); @Override boolean canCreate(); @Override void create(final Package pkg,
                       final String baseFileName,
                       final NewResourcePresenter presenter);  }