I'm currently working on a project for a client using this wonderful module, and they have the need to have one view that is available to anonymous users and other views that are available to users authenticated via OAuth, however unfortunately with a single service resource I can't have the fine grained control to do that.

Allowing for each View to have it's own service resource will not only allow this, but it will also give the ability to only allow specific Views to be available at all.

Patch in comment #1.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Deciphered’s picture

Status: Active » Needs review
FileSize
1.07 KB

One thing to note about the new resources, as they are 'actions' not 'CRUD' they are POST instead of GET, just the way the Services module works I'm afraid.

Also, apologies that this is for D6, I certainly no how I feel about dev in D6, but that's what the client needs, I have no doubt that the code should be simple to port for D7.

Deciphered’s picture

Minor update to the patch; Changed the source of arguments for the new Action resources, now expect POST data, this was done as it appeared the query string source was conflicting with the OAuth signatures.

Deciphered’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

This patch is also valid for Drupal 7.

qasimzee’s picture

In D7 I don't think with this patch we can restrict that only certain views should be accessible through services.

Deciphered’s picture

@qasimzee

I'm not sure if you're saying this Patch doesn't work or that it shouldn't be allowed, but I can assure you that it does work and that it should be allowed, as it doesn't prevent the existing functionality but adds to it, and I have clients that definitely have the use case where some views should be accessible to anonymous users where others should have authentication.

qasimzee’s picture

I am not saying it should not be allowed. It's a great idea.

What I am saying is that after applying the patch in D7, if I enable a specific view resource for example "Retrieves Example view", it doesn't work until I enable "Retrieves specified view". After enabling "Retrieves specified view.", every view becomes visible

qasimzee’s picture

Status: Needs review » Needs work
Deciphered’s picture

Reproduced issue, will try to reroll patch when I have a chance.