No permission for views_service module

I encountered another problem that I am assuming has to do with the lack of permissions for views_service.

First, my setup is completely up-to-date.

The problem is that from Flash on my desktop Services doesn't return any results from Views, ie the returned object is blank. When I change to a get a node, it works. The returned object contains all the pertinent information.

The strange thing is that under user permissions there is no mention of permissions for "views_service module." I am thinking the problem is that I cannot allow an "anonymous user" the option to "load any views data."

Any ideas as to what to do?

BTW - here is the code that I am using (save for appropriately commenting and uncommenting myService.call, and changes to the url and view name.)

package
{
    import flash.display.MovieClip
import flash.net.NetConnection;
    import flash.net.ObjectEncoding;
   import flash.net.Responder;

   public class mainPromo extends MovieClip
   {
      private var myService:NetConnection;
       private var myServiceURL:String;
       private var connectResponder:Responder;
        private var viewResponder:Responder;
       private var sessionID:String;
      /
         * Contructor
       */   
        public function mainPromo()
        {
          trace("in mainPromo");
           myService = new NetConnection();
           myService.objectEncoding = flash.net.ObjectEncoding.AMF3;
          myServiceURL = "URL TO AMFPHP";

         connectResponder = new Responder(getSessID, onError);

         myService.connect(myServiceURL);
           myService.call('system.connect', connectResponder);
      }
      /

         * getSessID
        */   
        private function getSessID(returnObject:*)
        {
          trace("in getSessID " + returnObject.sessid);
            viewResponder = new Responder(getViewInfo, onError);
           sessionID = returnObject.sessid;

          myService.call('views.get', viewResponder, sessionID, 'VIEW NAME');
//          myService.call('node.get', viewResponder, sessionID, NODEID);
        }
      /
         * getViewInfo
      /
        private function getViewInfo(returnObject:
)
      {
          trace("in getViewInfo " + returnObject);
           
           for (var item:* in returnObject) {
             trace(item + ": " + returnObject[item]);
         }
      }
      /

         * onError
      */   
        private function onError(f:*)
     {
          trace("Error" + f);
          for (var item:* in f)
         {
              trace(item + ": " + f[item]);
            }
      }
  }
}

Groups:
Login to post comments

Similar Issue?

pdjohnson's picture
pdjohnson - Tue, 2009-06-23 11:00

Hi,

i am trying to work with the views service and get access denied even when I try executing the request from Drupal Admin. I have every permission granted for the user role so to remove any question of access privileges and am logged in as user 1.

I have Use Keys and use sessionID selected. The service works if I turn this off.

Does anyone have any idea how to make requests to this service?


Patched?

bstoppel - Tue, 2009-06-23 14:44

Is your setup fully patched? I had a similar issue as reported here http://groups.drupal.org/node/22706.


Everything else works but this...

bstoppel - Wed, 2009-06-24 21:04

I've tried other services like user.login and it works. Views.get even works from within Drupal just not from Flash. Can anyone provide some insight?


function views_service_get()

bstoppel - Wed, 2009-06-24 21:58

I dove into the function views_service_get() to see if I could figure out what is going on. My findings so far are that the view itself is being called, but the property $view->result is empty when called from Flash. It is correct when called from within Drupal.


Anyone?

bstoppel - Thu, 2009-06-25 18:30

Has anyone successfully used Views2 with Services1? I am starting to believe that it is currently not possible.


Have you tried this patch

Amitaibu's picture
Amitaibu - Thu, 2009-06-25 18:53

Patch doesn't solve this problem

bstoppel - Thu, 2009-06-25 19:21

I hadn't tried that patch. It doesn't solve my problem. I get an empty div tag with this patch in place.

<div class="view view-nhm-main-page-promo view-id-nhm_main_page_promo view-display-id-default view-dom-id-1"></div>

Thanks for the thought though. I appreciate it.


You applied the patch - and

Amitaibu's picture
Amitaibu - Thu, 2009-06-25 19:25

You applied the patch - and set $format_output = TRUE? With the above patch only when $format_output is TRUE you should get your HTML, otherwise you should get the $view->result as an array.

Have you tried it on a different clean drupal installation?


[Solved] Clean install

bstoppel - Fri, 2009-06-26 15:43

It turns out that something is awry with my original Drupal install. I started a clean install and this appears to be working.


Cool. Have you apllied the

Amitaibu's picture
Amitaibu - Fri, 2009-06-26 15:51

Cool. Have you apllied the above patch?