signalpoint / DrupalGap

An application development kit for Drupal websites.
https://www.drupalgap.org
GNU General Public License v2.0
232 stars 185 forks source link

Improve node_access() #1002

Open jacobembree opened 6 years ago

jacobembree commented 6 years ago

I'd like to improve the node_access() function. For one thing, I'd like to add the op parameter so that node_access() can be used as an access callback for node/add/%. @signalpoint do you have any recommendations or suggestions before I start? I'm thinking of using Drupal.user.content_types_user_permissions extensively. Does node_access() indeed belong in DrupalGap or does it go in jDrupal?

signalpoint commented 6 years ago

@jacobembree I think node_access() can stay inside DrupalGap, since I assume folks using just jDrupal are building their own front end and access control layers.

If you'd like to add support for the op parameter, that'd be great. I personally don't use that feature very much on the front end, and have since used just the backend to determine access control, and then on the front end just try to make it so the UX can never land them in a spot where they don't have access to do something.

jacobembree commented 6 years ago

Almost all of my code came from Drupal's node_access() and node_node_access() functions.