#NEWLINE# def test_get_all_permission_grants_for_user( self ) : #NEWLINE# #INDENT# user_db = self . users [ '1_custom_role' ] #NEWLINE# role_db = self . roles [ 'custom_role_1' ] #NEWLINE# permission_grants = rbac_services . get_all_permission_grants_for_user ( user_db = user_db ) #NEWLINE# self . assertItemsEqual ( permission_grants , [ ] ) #NEWLINE# resource_db = self . resources [ 'rule_1' ] #NEWLINE# permission_types = [ PermissionType . RULE_CREATE , PermissionType . RULE_MODIFY ] #NEWLINE# permission_grant = rbac_services . create_permission_grant_for_resource_db ( role_db = role_db , resource_db = resource_db , permission_types = permission_types ) #NEWLINE# permission_grants = rbac_services . get_all_permission_grants_for_user ( user_db = user_db ) #NEWLINE# self . assertItemsEqual ( permission_grants , [ permission_grant ] ) #NEWLINE# permission_grants = rbac_services . get_all_permission_grants_for_user ( user_db = user_db , resource_types = [ ResourceType . PACK ] ) #NEWLINE# self . assertItemsEqual ( permission_grants , [ ] ) #NEWLINE# permission_grants = rbac_services . get_all_permission_grants_for_user ( user_db = user_db , resource_types = [ ResourceType . RULE ] ) #NEWLINE# self . assertItemsEqual ( permission_grants , [ permission_grant ] )