Codota Logo
ListQueryParameterObject.getAuthCheck
Code IndexAdd Codota to your IDE (free)

How to use
getAuthCheck
method
in
org.camunda.bpm.engine.impl.db.ListQueryParameterObject

Best Java code snippets using org.camunda.bpm.engine.impl.db.ListQueryParameterObject.getAuthCheck (Showing top 20 results out of 315)

  • Common ways to obtain ListQueryParameterObject
private void myMethod () {
ListQueryParameterObject l =
  • Codota Iconnew ListQueryParameterObject()
  • Smart code suggestions by Codota
}
origin: camunda/camunda-bpm-platform

@Test
public void shouldCheckDbForCfgValue_auto() {
 final ListQueryParameterObject query = new ListQueryParameterObject();
 final AuthorizationCheck authCheck = query.getAuthCheck();
 final HashMap<String, Object> expectedQueryParams = new HashMap<String, Object>();
 expectedQueryParams.put("userId", AUTHENTICATED_USER_ID);
 expectedQueryParams.put("authGroupIds", AUTHENTICATED_GROUPS);
 // given
 when(mockedConfiguration.getAuthorizationCheckRevokes()).thenReturn(ProcessEngineConfiguration.AUTHORIZATION_CHECK_REVOKE_AUTO);
 when(mockedEntityManager.selectBoolean(eq("selectRevokeAuthorization"), eq(expectedQueryParams))).thenReturn(true);
 // if
 authorizationManager.configureQuery(query);
 // then
 assertEquals(true, authCheck.isRevokeAuthorizationCheckEnabled());
 verify(mockedEntityManager, times(1)).selectBoolean(eq("selectRevokeAuthorization"), eq(expectedQueryParams));
}
origin: camunda/camunda-bpm-platform

@Test
public void shouldUseCfgValue_never() {
 final ListQueryParameterObject query = new ListQueryParameterObject();
 final AuthorizationCheck authCheck = query.getAuthCheck();
 // given
 when(mockedConfiguration.getAuthorizationCheckRevokes()).thenReturn(ProcessEngineConfiguration.AUTHORIZATION_CHECK_REVOKE_NEVER);
 // if
 authorizationManager.configureQuery(query);
 // then
 assertEquals(false, authCheck.isRevokeAuthorizationCheckEnabled());
 verify(mockedEntityManager, never()).selectBoolean(eq("selectRevokeAuthorization"), any());
 verifyNoMoreInteractions(mockedEntityManager);
}
origin: camunda/camunda-bpm-platform

@Test
public void shouldCheckDbForCfgValueWithNoRevokes_auto() {
 final ListQueryParameterObject query = new ListQueryParameterObject();
 final AuthorizationCheck authCheck = query.getAuthCheck();
 final HashMap<String, Object> expectedQueryParams = new HashMap<String, Object>();
 expectedQueryParams.put("userId", AUTHENTICATED_USER_ID);
 expectedQueryParams.put("authGroupIds", AUTHENTICATED_GROUPS);
 // given
 when(mockedConfiguration.getAuthorizationCheckRevokes()).thenReturn(ProcessEngineConfiguration.AUTHORIZATION_CHECK_REVOKE_AUTO);
 when(mockedEntityManager.selectBoolean(eq("selectRevokeAuthorization"), eq(expectedQueryParams))).thenReturn(false);
 // if
 authorizationManager.configureQuery(query);
 // then
 assertEquals(false, authCheck.isRevokeAuthorizationCheckEnabled());
 verify(mockedEntityManager, times(1)).selectBoolean(eq("selectRevokeAuthorization"), eq(expectedQueryParams));
}
origin: camunda/camunda-bpm-platform

@Test
public void shouldCheckDbForCfgCaseInsensitive() {
 final ListQueryParameterObject query = new ListQueryParameterObject();
 final AuthorizationCheck authCheck = query.getAuthCheck();
 final HashMap<String, Object> expectedQueryParams = new HashMap<String, Object>();
 expectedQueryParams.put("userId", AUTHENTICATED_USER_ID);
 expectedQueryParams.put("authGroupIds", AUTHENTICATED_GROUPS);
 // given
 when(mockedConfiguration.getAuthorizationCheckRevokes()).thenReturn("AuTo");
 when(mockedEntityManager.selectBoolean(eq("selectRevokeAuthorization"), eq(expectedQueryParams))).thenReturn(true);
 // if
 authorizationManager.configureQuery(query);
 // then
 assertEquals(true, authCheck.isRevokeAuthorizationCheckEnabled());
 verify(mockedEntityManager, times(1)).selectBoolean(eq("selectRevokeAuthorization"), eq(expectedQueryParams));
}
origin: camunda/camunda-bpm-platform

@Test
public void shouldCacheCheck() {
 final ListQueryParameterObject query = new ListQueryParameterObject();
 final AuthorizationCheck authCheck = query.getAuthCheck();
 final HashMap<String, Object> expectedQueryParams = new HashMap<String, Object>();
 expectedQueryParams.put("userId", AUTHENTICATED_USER_ID);
 expectedQueryParams.put("authGroupIds", AUTHENTICATED_GROUPS);
 // given
 when(mockedConfiguration.getAuthorizationCheckRevokes()).thenReturn(ProcessEngineConfiguration.AUTHORIZATION_CHECK_REVOKE_AUTO);
 when(mockedEntityManager.selectBoolean(eq("selectRevokeAuthorization"), eq(expectedQueryParams))).thenReturn(true);
 // if
 authorizationManager.configureQuery(query);
 authorizationManager.configureQuery(query);
 // then
 assertEquals(true, authCheck.isRevokeAuthorizationCheckEnabled());
 verify(mockedEntityManager, times(1)).selectBoolean(eq("selectRevokeAuthorization"), eq(expectedQueryParams));
}
origin: camunda/camunda-bpm-platform

public void configureQueryHistoricFinishedInstanceReport(ListQueryParameterObject query, Resource resource) {
 configureQuery(query);
 CompositePermissionCheck compositePermissionCheck = new PermissionCheckBuilder()
  .conjunctive()
   .atomicCheck(resource, "RES.KEY_", READ)
   .atomicCheck(resource, "RES.KEY_", READ_HISTORY)
  .build();
 query.getAuthCheck().setPermissionChecks(compositePermissionCheck);
}
origin: camunda/camunda-bpm-platform

public void configureQueryHistoricFinishedInstanceReport(ListQueryParameterObject query, Resource resource) {
 configureQuery(query);
 CompositePermissionCheck compositePermissionCheck = new PermissionCheckBuilder()
  .conjunctive()
   .atomicCheck(resource, "RES.KEY_", READ)
   .atomicCheck(resource, "RES.KEY_", READ_HISTORY)
  .build();
 query.getAuthCheck().setPermissionChecks(compositePermissionCheck);
}
origin: camunda/camunda-bpm-platform

@Test
public void shouldUseCfgValue_always() {
 final ListQueryParameterObject query = new ListQueryParameterObject();
 final AuthorizationCheck authCheck = query.getAuthCheck();
 // given
 when(mockedConfiguration.getAuthorizationCheckRevokes()).thenReturn(ProcessEngineConfiguration.AUTHORIZATION_CHECK_REVOKE_ALWAYS);
 // if
 authorizationManager.configureQuery(query);
 // then
 assertEquals(true, authCheck.isRevokeAuthorizationCheckEnabled());
 verifyNoMoreInteractions(mockedEntityManager);
}
origin: camunda/camunda-bpm-platform

protected void addPermissionCheck(ListQueryParameterObject query, Resource resource, String queryParam, Permission permission) {
 CommandContext commandContext = getCommandContext();
 if (isAuthorizationEnabled() && getCurrentAuthentication() != null && commandContext.isAuthorizationCheckEnabled()) {
  PermissionCheck permCheck = newPermissionCheck();
  permCheck.setResource(resource);
  permCheck.setResourceIdQueryParam(queryParam);
  permCheck.setPermission(permission);
  query.getAuthCheck().addAtomicPermissionCheck(permCheck);
 }
}
origin: camunda/camunda-bpm-platform

protected void addPermissionCheck(ListQueryParameterObject query, Resource resource, String queryParam, Permission permission) {
 CommandContext commandContext = getCommandContext();
 if (isAuthorizationEnabled() && getCurrentAuthentication() != null && commandContext.isAuthorizationCheckEnabled()) {
  PermissionCheck permCheck = newPermissionCheck();
  permCheck.setResource(resource);
  permCheck.setResourceIdQueryParam(queryParam);
  permCheck.setPermission(permission);
  query.getAuthCheck().addAtomicPermissionCheck(permCheck);
 }
}
origin: camunda/camunda-bpm-platform

public void configureQuery(ListQueryParameterObject query) {
 AuthorizationCheck authCheck = query.getAuthCheck();
 authCheck.getPermissionChecks().clear();
 if(isAuthCheckExecuted()) {
  Authentication currentAuthentication = getCurrentAuthentication();
  authCheck.setAuthUserId(currentAuthentication.getUserId());
  authCheck.setAuthGroupIds(currentAuthentication.getGroupIds());
  enableQueryAuthCheck(authCheck);
 }
 else {
  authCheck.setAuthorizationCheckEnabled(false);
  authCheck.setAuthUserId(null);
  authCheck.setAuthGroupIds(null);
 }
}
origin: camunda/camunda-bpm-platform

public void configureQuery(ListQueryParameterObject query) {
 AuthorizationCheck authCheck = query.getAuthCheck();
 authCheck.getPermissionChecks().clear();
 if(isAuthCheckExecuted()) {
  Authentication currentAuthentication = getCurrentAuthentication();
  authCheck.setAuthUserId(currentAuthentication.getUserId());
  authCheck.setAuthGroupIds(currentAuthentication.getGroupIds());
  enableQueryAuthCheck(authCheck);
 }
 else {
  authCheck.setAuthorizationCheckEnabled(false);
  authCheck.setAuthUserId(null);
  authCheck.setAuthGroupIds(null);
 }
}
origin: camunda/camunda-bpm-platform

public void configureExternalTaskFetch(ListQueryParameterObject parameter) {
 configureQuery(parameter);
 CompositePermissionCheck permissionCheck = newPermissionCheckBuilder()
  .conjunctive()
  .composite()
   .disjunctive()
   .atomicCheck(PROCESS_INSTANCE, "RES.PROC_INST_ID_", READ)
   .atomicCheck(PROCESS_DEFINITION, "RES.PROC_DEF_KEY_", READ_INSTANCE)
   .done()
  .composite()
   .disjunctive()
   .atomicCheck(PROCESS_INSTANCE, "RES.PROC_INST_ID_", UPDATE)
   .atomicCheck(PROCESS_DEFINITION, "RES.PROC_DEF_KEY_", UPDATE_INSTANCE)
   .done()
  .build();
 addPermissionCheck(parameter.getAuthCheck(), permissionCheck);
}
origin: camunda/camunda-bpm-platform

public void configureExternalTaskFetch(ListQueryParameterObject parameter) {
 configureQuery(parameter);
 CompositePermissionCheck permissionCheck = newPermissionCheckBuilder()
  .conjunctive()
  .composite()
   .disjunctive()
   .atomicCheck(PROCESS_INSTANCE, "RES.PROC_INST_ID_", READ)
   .atomicCheck(PROCESS_DEFINITION, "RES.PROC_DEF_KEY_", READ_INSTANCE)
   .done()
  .composite()
   .disjunctive()
   .atomicCheck(PROCESS_INSTANCE, "RES.PROC_INST_ID_", UPDATE)
   .atomicCheck(PROCESS_DEFINITION, "RES.PROC_DEF_KEY_", UPDATE_INSTANCE)
   .done()
  .build();
 addPermissionCheck(parameter.getAuthCheck(), permissionCheck);
}
origin: org.camunda.bpm/camunda-engine

@Test
public void shouldCheckDbForCfgValue_auto() {
 final ListQueryParameterObject query = new ListQueryParameterObject();
 final AuthorizationCheck authCheck = query.getAuthCheck();
 final HashMap<String, Object> expectedQueryParams = new HashMap<String, Object>();
 expectedQueryParams.put("userId", AUTHENTICATED_USER_ID);
 expectedQueryParams.put("authGroupIds", AUTHENTICATED_GROUPS);
 // given
 when(mockedConfiguration.getAuthorizationCheckRevokes()).thenReturn(ProcessEngineConfiguration.AUTHORIZATION_CHECK_REVOKE_AUTO);
 when(mockedEntityManager.selectBoolean(eq("selectRevokeAuthorization"), eq(expectedQueryParams))).thenReturn(true);
 // if
 authorizationManager.configureQuery(query);
 // then
 assertEquals(true, authCheck.isRevokeAuthorizationCheckEnabled());
 verify(mockedEntityManager, times(1)).selectBoolean(eq("selectRevokeAuthorization"), eq(expectedQueryParams));
}
origin: org.camunda.bpm/camunda-engine

@Test
public void shouldUseCfgValue_never() {
 final ListQueryParameterObject query = new ListQueryParameterObject();
 final AuthorizationCheck authCheck = query.getAuthCheck();
 // given
 when(mockedConfiguration.getAuthorizationCheckRevokes()).thenReturn(ProcessEngineConfiguration.AUTHORIZATION_CHECK_REVOKE_NEVER);
 // if
 authorizationManager.configureQuery(query);
 // then
 assertEquals(false, authCheck.isRevokeAuthorizationCheckEnabled());
 verify(mockedEntityManager, never()).selectBoolean(eq("selectRevokeAuthorization"), any());
 verifyNoMoreInteractions(mockedEntityManager);
}
origin: org.camunda.bpm/camunda-engine

@Test
public void shouldUseCfgValue_always() {
 final ListQueryParameterObject query = new ListQueryParameterObject();
 final AuthorizationCheck authCheck = query.getAuthCheck();
 // given
 when(mockedConfiguration.getAuthorizationCheckRevokes()).thenReturn(ProcessEngineConfiguration.AUTHORIZATION_CHECK_REVOKE_ALWAYS);
 // if
 authorizationManager.configureQuery(query);
 // then
 assertEquals(true, authCheck.isRevokeAuthorizationCheckEnabled());
 verifyNoMoreInteractions(mockedEntityManager);
}
origin: org.camunda.bpm/camunda-engine

public void configureQueryHistoricFinishedInstanceReport(ListQueryParameterObject query, Resource resource) {
 configureQuery(query);
 CompositePermissionCheck compositePermissionCheck = new PermissionCheckBuilder()
  .conjunctive()
   .atomicCheck(resource, "RES.KEY_", READ)
   .atomicCheck(resource, "RES.KEY_", READ_HISTORY)
  .build();
 query.getAuthCheck().setPermissionChecks(compositePermissionCheck);
}
origin: org.camunda.bpm/camunda-engine

protected void addPermissionCheck(ListQueryParameterObject query, Resource resource, String queryParam, Permission permission) {
 CommandContext commandContext = getCommandContext();
 if (isAuthorizationEnabled() && getCurrentAuthentication() != null && commandContext.isAuthorizationCheckEnabled()) {
  PermissionCheck permCheck = newPermissionCheck();
  permCheck.setResource(resource);
  permCheck.setResourceIdQueryParam(queryParam);
  permCheck.setPermission(permission);
  query.getAuthCheck().addAtomicPermissionCheck(permCheck);
 }
}
origin: org.camunda.bpm/camunda-engine

public void configureQuery(ListQueryParameterObject query) {
 AuthorizationCheck authCheck = query.getAuthCheck();
 authCheck.getPermissionChecks().clear();
 if(isAuthCheckExecuted()) {
  Authentication currentAuthentication = getCurrentAuthentication();
  authCheck.setAuthUserId(currentAuthentication.getUserId());
  authCheck.setAuthGroupIds(currentAuthentication.getGroupIds());
  enableQueryAuthCheck(authCheck);
 }
 else {
  authCheck.setAuthorizationCheckEnabled(false);
  authCheck.setAuthUserId(null);
  authCheck.setAuthGroupIds(null);
 }
}
org.camunda.bpm.engine.impl.dbListQueryParameterObjectgetAuthCheck

Popular methods of ListQueryParameterObject

  • <init>
  • getMaxResults
  • getFirstResult
  • getOrderingProperties
  • getTenantCheck
  • setParameter
  • getOrderBy
  • getParameter

Popular in Java

  • Finding current android device location
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • BoxLayout (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now