Index: services_views.module
===================================================================

@@ -95,18 +95,60 @@
  *  Boolean. TRUE if the user is allowed to load the given view.
  */
 function services_views_access($op = 'view', $args = array()) {
+  
+  $args = _services_views_normalize_args($args);
+  
   switch ($op) {
     case 'view':
-      $view = views_get_view($args['view_name']);
+      $view = views_get_view($args[0]->view_name);
       if (empty($view)) {
-        return services_error(t('View @view could not be found', array('@view' => $args['view_name'])), 404);
+        return services_error(t('View @view could not be found', array('@view' => $args[0]->view_name)), 404);
       }
-      if (!isset($view->display[$args['display_id']])) {
+      if (!isset($view->display[$args[1]->display_id])) {
         return services_error(t('Display @display on view @view could not be found', array(
-          '@display' => $args['display_id'],
-          '@view' => $args['view_name'],
+          '@display' => $args[1]->display_id,
+          '@view' => $args[0]->view_name,
         )), 404);
       }
-      return $view->access($args['display_id']);
+      return $view->access($args[1]->display_id);
   }
 }
+
+/**
+ * Normalize arguments into objects, if not the case (eg. data from AMFserver)
+ * note: similar to node_resource
+ * 
+ * @param $args
+ *  Array. The arguments that will be passed to the callback.
+ */
+
+function _services_views_normalize_args($args) {
+  
+  $args[0] = _services_views_normalize_arg($args[0], 'view_name');
+  
+  if(isset($args[1]))
+    $args[1] = _services_views_normalize_arg($args[1], 'display_id');
+  elseif(isset($args['display_id']))
+    $args[1] = (object) array('display_id', $args['display_id']);
+  
+  return $args;
+}
+
+/**
+ * Normalize one argument
+ * 
+ * @param $arg
+ *  * (Array or Object). The arguments that will be passed to the callback.
+ * @param $arg_name
+ *  String. The argument name.
+ */
+
+function _services_views_normalize_arg($arg, $arg_name) {
+  
+  if (is_array($arg)) 
+    $arg = (object) $arg;
+  elseif (!is_array($arg) && !is_object($arg))  
+    $arg = (object) array($arg_name => $arg);
+   
+  return $arg;
+}
\ No newline at end of file
