Class PermissionCheckingServiceTest
java.lang.Object
de.hybris.platform.testframework.HybrisJUnit4Test
de.hybris.platform.servicelayer.ServicelayerBaseTest
de.hybris.platform.servicelayer.ServicelayerTransactionalBaseTest
de.hybris.platform.servicelayer.security.permissions.AbstractPermissionServiceTest
de.hybris.platform.servicelayer.security.permissions.PermissionCheckingServiceTest
- All Implemented Interfaces:
JaloSessionHolder
Tests
PermissionCheckingService service public API-
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.security.permissions.AbstractPermissionServiceTest
flexibleSearchService, TEST_PERMISSION_1, TEST_PERMISSION_2, TEST_PERMISSION_3, TEST_PERMISSION_4, TEST_PERMISSION_5, TEST_USER_1_UID, TEST_USER_2_UID, TEST_USER_3_UID, TEST_USER_4_UID, testUser1, testUser2Fields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected UserRightModelgetPermissionForName(String permissionName) protected voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidTests global permission assignments on principal (no principal hierarchy involved)voidvoidChecks for correct behavior of global permission assignments involving principal groups hierarchy checking.voidvoidvoidTests the item permission assignment algorithm: first item, then item's type, then global The idea is simple: We have 4 permissions: TEST_PERMISSION_1..4 We'll assign TEST_PERMISSION_1 on the item level, TEST_PERMISSION_2 on the type level, TEST_PERMISSION_3 on the global level.voidvoidvoidvoidvoidvoidLong scenario-like test.voidThis focuses on testing if type permission assignments checks do fall-back to global permission assignments when nothing is found on the type level.voidvoidvoidvoidvoidTest the way existing group hierarchy worksvoidTest the way existing type hierarchy worksvoidvoidChecking for not-existing permissionsMethods inherited from class de.hybris.platform.servicelayer.security.permissions.AbstractPermissionServiceTest
getTenant, setUpMethods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getApplicationContext, getBeanName, prepareApplicationContextAndSessionMethods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
Constructor Details
-
PermissionCheckingServiceTest
public PermissionCheckingServiceTest()
-
-
Method Details
-
testFalseCyclicGroupMembershipBug
public void testFalseCyclicGroupMembershipBug() -
testExistingGroupHierarchyTraversal
public void testExistingGroupHierarchyTraversal()Test the way existing group hierarchy works -
testExistingTypeHierarchyTraversal
public void testExistingTypeHierarchyTraversal()Test the way existing type hierarchy works -
testCheckItemPermissionWithItemNull
public void testCheckItemPermissionWithItemNull() -
testCheckItemPermissionWithPrincipalNull
public void testCheckItemPermissionWithPrincipalNull() -
testCheckItemPermissionWithPermissionNameNull
public void testCheckItemPermissionWithPermissionNameNull() -
testCheckTypePermissionWithTypeNull
public void testCheckTypePermissionWithTypeNull() -
testCheckTypePermissionWithTypeCodeNull
public void testCheckTypePermissionWithTypeCodeNull() -
testCheckTypePermissionWithPrincipalNull
public void testCheckTypePermissionWithPrincipalNull() -
testCheckTypePermissionWithPermissionNameNull
public void testCheckTypePermissionWithPermissionNameNull() -
testCheckAttributePermissionWithAttributeNull
public void testCheckAttributePermissionWithAttributeNull() -
testCheckAttributePermissionWithPrincipalNull
public void testCheckAttributePermissionWithPrincipalNull() -
testCheckAttributePermissionWithPermissionNameNull
public void testCheckAttributePermissionWithPermissionNameNull() -
testCheckAttributePermissionWithTypeCodeNull
public void testCheckAttributePermissionWithTypeCodeNull() -
testCheckAttributePermissionWithAttributeQualifierNull
public void testCheckAttributePermissionWithAttributeQualifierNull() -
testCheckAttributePermissionByCodeWithPrincipalNull
public void testCheckAttributePermissionByCodeWithPrincipalNull() -
testCheckAttributePermissionByCodeWithPermissionNameNull
public void testCheckAttributePermissionByCodeWithPermissionNameNull() -
testCheckGlobalPermissionWithPrincipalNull
public void testCheckGlobalPermissionWithPrincipalNull() -
testCheckGlobalPermissionWithPermissionNameNull
public void testCheckGlobalPermissionWithPermissionNameNull() -
testCheckGlobalPermissionForAdmin
public void testCheckGlobalPermissionForAdmin() -
testCheckAttributeDescriptorPermissionForAdmin
public void testCheckAttributeDescriptorPermissionForAdmin() -
testCheckItemPermissionForAdmin
public void testCheckItemPermissionForAdmin() -
testCheckTypePermissionForAdmin
public void testCheckTypePermissionForAdmin() -
testNoExistingPermissions
public void testNoExistingPermissions()Checking for not-existing permissions -
testCheckGlobalPermissionDirectlyAssigned
public void testCheckGlobalPermissionDirectlyAssigned()Tests global permission assignments on principal (no principal hierarchy involved) -
testCheckGlobalPermissionsWithinPrincipalHierarchy
public void testCheckGlobalPermissionsWithinPrincipalHierarchy()Checks for correct behavior of global permission assignments involving principal groups hierarchy checking. The test involve testing for group hierarchy traversing rules, which are the same when checking for item/type/attribute permission assignments. -
testCheckTypePermissions
public void testCheckTypePermissions()Long scenario-like test. Test different cases for type permission assignments. Unfortunately there's so many of possibilities here that it's impossible to cover them all. -
testCheckTypePermissionsGlobalPermissionsFallback
public void testCheckTypePermissionsGlobalPermissionsFallback()This focuses on testing if type permission assignments checks do fall-back to global permission assignments when nothing is found on the type level. -
testCheckItemPermission
public void testCheckItemPermission()Tests the item permission assignment algorithm: first item, then item's type, then global The idea is simple: We have 4 permissions: TEST_PERMISSION_1..4 We'll assign TEST_PERMISSION_1 on the item level, TEST_PERMISSION_2 on the type level, TEST_PERMISSION_3 on the global level. TEST_PERMISSION_4 will remain unassigned. Then we'll perform checks to ensure that our test user has all three permissions granted, (but not the TEST_PERMISSION_4) -
testAttributeDescriptorPermissions
public void testAttributeDescriptorPermissions() -
prepareGroups
protected void prepareGroups() -
getPermissionForName
-