@Test public void testKillTasksWithTargetedPermission() throws TException { expect(subject.isPermitted(interceptor.makeTargetPermission("killTasks", JOB_KEY))) .andReturn(false); expect(subject.getPrincipal()).andReturn("zmanji"); replayAndInitialize(); assertEquals( ResponseCode.AUTH_FAILED, decoratedThrift.killTasks(JOB_KEY.newBuilder(), null).getResponseCode()); }
@VisibleForTesting Permission makeTargetPermission(String methodName, IJobKey jobKey) { return Permissions.createJobScopedPermission(methodName, jobKey); }
ShiroAuthorizingParamInterceptor implements MethodInterceptor { @VisibleForTesting Permission makeTargetPermission(String methodName, IJobKey jobKey) { return Permissions.createJobScopedPermission(methodName, jobKey); } }
ShiroAuthorizingParamInterceptor implements MethodInterceptor { @VisibleForTesting Permission makeTargetPermission(String methodName, IJobKey jobKey) { return Permissions.createJobScopedPermission(methodName, jobKey); }  }
ShiroAuthorizingParamInterceptor implements MethodInterceptor { @VisibleForTesting Permission makeTargetPermission(String methodName, IJobKey jobKey) { return Permissions.createJobScopedPermission(methodName, jobKey); }  @Override Object invoke(MethodInvocation invocation); }
ShiroAuthorizingParamInterceptor implements MethodInterceptor { @VisibleForTesting Permission makeTargetPermission(String methodName, IJobKey jobKey) { return Permissions.createJobScopedPermission(methodName, jobKey); }  @Override Object invoke(MethodInvocation invocation);  }