def authorized_cube(cube_name, locale):
 try:
  cube = workspace.cube(cube_name, g.auth_identity, locale=locale)
 except NotAuthorized:
  ident = (("'%s'" % g.auth_identity) if g.auth_identity else 'unspecified identity')
  raise NotAuthorizedError(("Authorization of cube '%s' failed for %s" % (cube_name, ident)))
 return cube

def authorized_cube ( cube_name , locale ) : try : cube = workspace . cube ( cube_name , g . auth_identity , locale = locale ) except NotAuthorized : ident = ( ( "'%s'" % g . auth_identity ) if g . auth_identity else 'unspecified identity' ) raise NotAuthorizedError ( ( "Authorization of cube '%s' failed for %s" % ( cube_name , ident ) ) ) return cube
returns a cube cube_name .