use of org.camunda.bpm.engine.impl.persistence.entity.AuthorizationManager in project camunda-bpm-platform by camunda.
the class AuthorizationCheckRevokesCfgTest method setup.
@Before
public void setup() {
mockedCmdContext = mock(CommandContext.class);
mockedConfiguration = mock(ProcessEngineConfigurationImpl.class);
authorizationManager = spy(new AuthorizationManager());
mockedEntityManager = mock(DbEntityManager.class);
when(mockedCmdContext.getSession(eq(DbEntityManager.class))).thenReturn(mockedEntityManager);
when(authorizationManager.filterAuthenticatedGroupIds(eq(AUTHENTICATED_GROUPS))).thenReturn(AUTHENTICATED_GROUPS);
when(mockedCmdContext.getAuthentication()).thenReturn(new Authentication(AUTHENTICATED_USER_ID, AUTHENTICATED_GROUPS));
when(mockedCmdContext.isAuthorizationCheckEnabled()).thenReturn(true);
when(mockedConfiguration.isAuthorizationEnabled()).thenReturn(true);
Context.setCommandContext(mockedCmdContext);
Context.setProcessEngineConfiguration(mockedConfiguration);
}
use of org.camunda.bpm.engine.impl.persistence.entity.AuthorizationManager in project camunda-bpm-platform by camunda.
the class DeleteAuthorizationCmd method execute.
public Void execute(CommandContext commandContext) {
final AuthorizationManager authorizationManager = commandContext.getAuthorizationManager();
AuthorizationEntity authorization = (AuthorizationEntity) new AuthorizationQueryImpl().authorizationId(authorizationId).singleResult();
ensureNotNull("Authorization for Id '" + authorizationId + "' does not exist", "authorization", authorization);
authorizationManager.delete(authorization);
return null;
}
Aggregations