def _resolve_layer(request, typename, permission='base.view_resourcebase', msg=_PERMISSION_MSG_GENERIC, **kwargs):
 service_typename = typename.split(':', 1)
 if Service.objects.filter(name=service_typename[0]).exists():
  service = Service.objects.filter(name=service_typename[0])
  return resolve_object(request, Layer, {'typename': (service_typename[1] if (service[0].method != 'C') else typename)}, permission=permission, permission_msg=msg, **kwargs)
 else:
  return resolve_object(request, Layer, {'typename': typename}, permission=permission, permission_msg=msg, **kwargs)

def _resolve_layer ( request , typename , permission = 'base.view_resourcebase' , msg = _PERMISSION_MSG_GENERIC , ** kwargs ) : service_typename = typename . split ( ':' , 1 ) if Service . objects . filter ( name = service_typename [ 0 ] ) . exists ( ) : service = Service . objects . filter ( name = service_typename [ 0 ] ) return resolve_object ( request , Layer , { 'typename' : ( service_typename [ 1 ] if ( service [ 0 ] . method != 'C' ) else typename ) } , permission = permission , permission_msg = msg , ** kwargs ) else : return resolve_object ( request , Layer , { 'typename' : typename } , permission = permission , permission_msg = msg , ** kwargs )
resolve the layer by the provided typename and check the optional permission .