First, thanks so much for making this module. Now that Blog API is dead for Drupal 7, none of the popular offline blogging apps work, and a client of mine really wanted an easy way to update his site via iPhone.

My question--if I log in with uid:1, I can add and edit all content. But I can't figure out the permissions required to enable DrupalGap adding/editing of content for other roles. I tried enabling all the Services permissions to the role, as well as DrupalGap administration rights, and still don't see any Content options in the app. Can you let me know what permissions are needed for a role to use DrupalGap?

Comments

Anonymous’s picture

you just need to set Node permission for roles
for example set: 'Article: Create new content' or 'Article: Edit own content'

s.daniel’s picture

Have you given the role of the user (e.g. Administrator or authentificated user) access to create/edit/delete the particular content type you are interested?

tyler.frankenstein’s picture

Assigned: Unassigned » tyler.frankenstein
Status: Active » Needs review

Since DrupalGap communicates with it's Drupal site via the Services and Views JSON (views_datasource) module, all calls to the website via the Services module will fall back to the permissions specified within Drupal's User Permissions interface, all calls to the website via Views JSON will fall back to the permissions specified on that particular view's access settings.

So, if you allow anonymous users to post comments, then an anonymous user within the mobile application will be able to post comments (via the Comment Create service resource).

If you allow authenticated users to create Article content, then a user logged into the mobile app will be able to create Article content (via the Node Create service resource).

If you have a Views JSON page display setup that will return a list of content, then when the mobile application requests that JSON via the page URL, Drupal will ask that particular view what role/permission is allowed to access this view's results.

When DrupalGap performs its system connect resource call (not the default system connect resource call), it also rounds up all the permissions and roles the current user has, that way dynamic permission/role based decisions can be made when programming the mobile app.

twoblackeyes’s picture

Thanks all for the replies. Yeah, this role I'm trying to set up for DrupalGap has all the necessary permissions to create content, and when logged in through the site itself, users with that role have all the permissions they need. Somehow in my install the permissions aren't reaching DrupalGap, because I still only see Create Content options for uid:1.

I'm not running anything fancy or abnormal on this site re: permissions or content types. Anywhere else I can look to troubleshoot? Thanks again for the help.

tyler.frankenstein’s picture

Is this problem related to the DrupalGap mobile application available in the Google and Apple mobile application stores? Or is this related to a custom mobile application you are developing?

If it is the latter, try using the Firefox Poster plugin to make a POST call to your DrupalGap System Connect resource:

http://www.example.com/?q=drupalgap/drupalgap_system/connect.json

This will tell you about the particular user's roles and permissions.

Alternatively, you can review the LogCat console in Eclipse during your mobile application execution to see all kinds of debug information.

Be sure to check out the documentation link on the DrupalGap module home page for setup instructions and trouble shooting topics.

s.daniel’s picture

What I found usefull for debugging are the chrome debugging tools / firebug. Just upload the app of yours to the same domain that drupal runs on and you can access the app pretty much like you do through the phone but with the possibility to set breakpoints look into variables etc.

I've uploaded an example here for you to compare: eb.a7n.de/app/app.cur/

twoblackeyes’s picture

Thanks for the help guys. I'm not sure I entirely understand the tip in #6 re: hosting the app. My goal is to use the stock iOS app as downloaded from iTunes to make simple updates to a Drupal site. I'm not customizing the mobile app component at all--I just need to enable permissions on the Drupal site so I can update. I created a new role on the site and gave it all permissions, and logging in with that user via DrupalGap I can create content and edit my own content. So it's not just uid;1 that works (although uid:1 seems to be the only login that will allow for editing ANY content).

I just can't divine what permissions I'm missing from the role I'd like to set up with permissions only to update the mobile app.

s.daniel’s picture

#6 does not apply for your use case then.

Look for "create/edit/delete [your_content_type] content"

See http://drupal.org/node/132202 for more details about the drupal permissions.

tyler.frankenstein’s picture

Status: Needs review » Closed (works as designed)

Closing this issue, sounds like the problem has been resolved. Please re-open if need be.

vipul.jadvani’s picture

Hello ,
I have th same problem here. with administrator login , i can add contents. but with an authenticated user , i cant add and there is no option for it. i have give enough permission to authenticated user. In drupal site , i can add content with that permission but in drupalgap app , i cant not add content. i am using ripple factor in chrome browser for drupalgap app.
so please help me.

Thanks,
vipul.

tyler.frankenstein’s picture

@vipul.jadvani, inside of DrupalGap, have the authenticated user navigate to 'node/add' and you should see a list of content types the user has permission to create.

By default, the 'sub_navigation' region inside the settings.js file, has the 'main_menu' block which is only visible to user's with the role 'administrator'. Make sure that block is visible to authenticated users, then you should be able to see the 'Content' link where they can add content.

If that doesn't work, please elaborate in more detail the problem you are having, or stop by IRC to chat, thanks.

vipul.jadvani’s picture

Thanks tyler.frankenstein, my problem is solved. In seetings.js, i had set up main_menu block visible to authenticated users.