def _validate_permission_types(resource_db, permission_types):
 resource_db = _validate_resource_type(resource_db=resource_db)
 resource_type = resource_db.get_resource_type()
 valid_permission_types = PermissionType.get_valid_permissions_for_resource_type(resource_type)
 for permission_type in permission_types:
  if (permission_type not in valid_permission_types):
   raise ValueError(('Invalid permission type: %s' % permission_type))
 return permission_types

def _validate_permission_types ( resource_db , permission_types ) : resource_db = _validate_resource_type ( resource_db = resource_db ) resource_type = resource_db . get_resource_type ( ) valid_permission_types = PermissionType . get_valid_permissions_for_resource_type ( resource_type ) for permission_type in permission_types : if ( permission_type not in valid_permission_types ) : raise ValueError ( ( 'Invalid permission type: %s' % permission_type ) ) return permission_types
validate that the permission_types list only contains valid values for the provided resource .