Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | resource_per_view-1871820-2.patch | 1.29 KB | Deciphered |
#2 | interdiff.txt | 729 bytes | Deciphered |
#1 | resource_per_view-1871820-1.patch | 1.07 KB | Deciphered |
Comments
Comment #1
Deciphered CreditAttribution: Deciphered commentedOne 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.
Comment #2
Deciphered CreditAttribution: Deciphered commentedMinor 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.
Comment #3
Deciphered CreditAttribution: Deciphered commentedThis patch is also valid for Drupal 7.
Comment #4
qasimzee CreditAttribution: qasimzee commentedIn D7 I don't think with this patch we can restrict that only certain views should be accessible through services.
Comment #5
Deciphered CreditAttribution: Deciphered commented@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.
Comment #6
qasimzee CreditAttribution: qasimzee commentedI 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
Comment #7
qasimzee CreditAttribution: qasimzee commentedComment #8
Deciphered CreditAttribution: Deciphered commentedReproduced issue, will try to reroll patch when I have a chance.