def _dispatch(table, action, user, obj):
 if (action in table):
  result = table[action]()
  debug('%s user %s, object %s, action %s', ('ALLOWED' if result else 'DENIED'), user, (obj.location.to_deprecated_string() if isinstance(obj, XBlock) else str(obj)), action)
  return result
 raise ValueError(u"Unknown action for object type '{0}': '{1}'".format(type(obj), action))

def _dispatch ( table , action , user , obj ) : if ( action in table ) : result = table [ action ] ( ) debug ( '%s user %s, object %s, action %s' , ( 'ALLOWED' if result else 'DENIED' ) , user , ( obj . location . to_deprecated_string ( ) if isinstance ( obj , XBlock ) else str ( obj ) ) , action ) return result raise ValueError ( u"Unknown action for object type '{0}': '{1}'" . format ( type ( obj ) , action ) )
decorator for dispatch by opcode .