use of org.springframework.security.test.context.support.WithMockUser in project ranger by apache.
the class RangerKylinAuthorizerTest method adminProjectTestWithoutPermission.
/**
* yuwen admin test_project failed
*/
@Test
@WithMockUser(username = YUWEN, roles = { ROLE_USER })
public void adminProjectTestWithoutPermission() {
ProjectInstance project = name2Projects.get(TEST_PROJECT);
boolean result = aclEvaluate.hasProjectAdminPermission(project);
Assert.assertFalse(result);
}
use of org.springframework.security.test.context.support.WithMockUser in project ranger by apache.
the class RangerKylinAuthorizerTest method readProjectKylinWithQueryPermission.
/**
* yuwen read kylin_project success
*/
@Test
@WithMockUser(username = YUWEN, roles = { ROLE_USER })
public void readProjectKylinWithQueryPermission() {
ProjectInstance project = name2Projects.get(KYLIN_PROJECT);
boolean result = aclEvaluate.hasProjectReadPermission(project);
Assert.assertTrue(result);
}
use of org.springframework.security.test.context.support.WithMockUser in project ranger by apache.
the class RangerKylinAuthorizerTest method adminProjectTestWithAdminPermission.
/**
* zhangqiang admin test_project success
*/
@Test
@WithMockUser(username = ZHANGQIANG, roles = { ROLE_USER })
public void adminProjectTestWithAdminPermission() {
ProjectInstance project = name2Projects.get(TEST_PROJECT);
boolean result = aclEvaluate.hasProjectAdminPermission(project);
Assert.assertTrue(result);
}
use of org.springframework.security.test.context.support.WithMockUser in project ranger by apache.
the class RangerKylinAuthorizerTest method adminProjectKylinWithoutPermission2.
/**
* yuwen admin kylin_project failed
*/
@Test
@WithMockUser(username = YUWEN, roles = { ROLE_USER })
public void adminProjectKylinWithoutPermission2() {
ProjectInstance project = name2Projects.get(KYLIN_PROJECT);
boolean result = aclEvaluate.hasProjectAdminPermission(project);
Assert.assertFalse(result);
}
use of org.springframework.security.test.context.support.WithMockUser in project ranger by apache.
the class RangerKylinAuthorizerTest method readProjectTestWithManagementPermission.
/**
* yuwen read test_project success
*/
@Test
@WithMockUser(username = YUWEN, roles = { ROLE_USER })
public void readProjectTestWithManagementPermission() {
ProjectInstance project = name2Projects.get(TEST_PROJECT);
boolean result = aclEvaluate.hasProjectReadPermission(project);
Assert.assertTrue(result);
}
Aggregations