@require_admin_context
def group_type_access_add(context, type_id, project_id):
 group_type_id = _group_type_get_id_from_group_type(context, type_id)
 access_ref = models.GroupTypeProjects()
 access_ref.update({'group_type_id': group_type_id, 'project_id': project_id})
 session = get_session()
 with session.begin():
  try:
   access_ref.save(session=session)
  except db_exc.DBDuplicateEntry:
   raise exception.GroupTypeAccessExists(group_type_id=type_id, project_id=project_id)
  return access_ref

@ require_admin_context def group_type_access_add ( context , type_id , project_id ) : group_type_id = _group_type_get_id_from_group_type ( context , type_id ) access_ref = models . GroupTypeProjects ( ) access_ref . update ( { 'group_type_id' : group_type_id , 'project_id' : project_id } ) session = get_session ( ) with session . begin ( ) : try : access_ref . save ( session = session ) except db_exc . DBDuplicateEntry : raise exception . GroupTypeAccessExists ( group_type_id = type_id , project_id = project_id ) return access_ref
add given tenant to the group type access list .