use of io.crnk.security.model.Project in project crnk-framework by crnk-project.
the class SecurityModuleIntTest method metaAllPermissions.
@Test
public void metaAllPermissions() {
identityManager.addUser("doe", "doePass", "allRole");
ResourceList<Project> list = projectRepo.findAll(new QuerySpec(Project.class));
ResourcePermissionInformation metaInformation = list.getMeta(ResourcePermissionInformationImpl.class);
ResourcePermission resourcePermission = metaInformation.getResourcePermission();
Assert.assertEquals(ResourcePermission.ALL, resourcePermission);
}
use of io.crnk.security.model.Project in project crnk-framework by crnk-project.
the class SecurityModuleIntTest method rootAll.
@Test
public void rootAll() {
identityManager.addUser("doe", "doePass", "allRole");
Project project = new Project();
project.setId(1L);
project.setName("test");
projectRepo.create(project);
project.setName("updated");
projectRepo.save(project);
project = projectRepo.findOne(project.getId(), new QuerySpec(Project.class));
Assert.assertNotNull(project);
projectRepo.delete(project.getId());
}
use of io.crnk.security.model.Project in project crnk-framework by crnk-project.
the class SecurityModuleIntTest method getPostOnly.
@Test
public void getPostOnly() {
identityManager.addUser("doe", "doePass", "getRole", "postRole");
Project project = new Project();
project.setId(1L);
project.setName("test");
projectRepo.create(project);
project = projectRepo.findOne(project.getId(), new QuerySpec(Project.class));
Assert.assertNotNull(project);
}
use of io.crnk.security.model.Project in project crnk-framework by crnk-project.
the class SecurityModuleIntTest method permitAllMatchProjectType.
@Test
public void permitAllMatchProjectType() {
identityManager.addUser("doe", "doePass");
Project project = new Project();
project.setId(1L);
project.setName("test");
projectRepo.create(project);
}
use of io.crnk.security.model.Project in project crnk-framework by crnk-project.
the class SecurityModuleIntTest method metaGetPatchPermissions.
@Test
public void metaGetPatchPermissions() {
identityManager.addUser("doe", "doePass");
ResourceList<Project> list = projectRepo.findAll(new QuerySpec(Project.class));
ResourcePermissionInformation metaInformation = list.getMeta(ResourcePermissionInformationImpl.class);
ResourcePermission resourcePermission = metaInformation.getResourcePermission();
Assert.assertEquals(ResourcePermission.GET.or(ResourcePermission.POST), resourcePermission);
}