def add_volume_type_access(context, volume_type_id, project_id):
 if (volume_type_id is None):
  msg = _('volume_type_id cannot be None')
  raise exception.InvalidVolumeType(reason=msg)
 elevated = (context if context.is_admin else context.elevated())
 if is_public_volume_type(elevated, volume_type_id):
  msg = _('Type access modification is not applicable to public volume type.')
  raise exception.InvalidVolumeType(reason=msg)
 db.volume_type_access_add(elevated, volume_type_id, project_id)
 notify_about_volume_type_access_usage(context, volume_type_id, project_id, 'access.add')

def add_volume_type_access ( context , volume_type_id , project_id ) : if ( volume_type_id is None ) : msg = _ ( 'volume_type_id cannot be None' ) raise exception . InvalidVolumeType ( reason = msg ) elevated = ( context if context . is_admin else context . elevated ( ) ) if is_public_volume_type ( elevated , volume_type_id ) : msg = _ ( 'Type access modification is not applicable to public volume type.' ) raise exception . InvalidVolumeType ( reason = msg ) db . volume_type_access_add ( elevated , volume_type_id , project_id ) notify_about_volume_type_access_usage ( context , volume_type_id , project_id , 'access.add' )
add access to volume type for project_id .