I have permissions set as follows:

Ask a question: ANONYMOUS USER & AUTHENTICATED USER checked
FAQ: Create new content: ANONYMOUS USER & AUTHENTICATED USER checked

However when I go to the page where the user is supposed to be able to ask a question,
...drupal/node/add/faq?ask=TRUE

I get the message "You are not authorized to access this page."

I saw this was an issue in FAQ_ASK 6.x and thought it was resolved in 7.

Any ideas on how to get this working?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stenjo’s picture

Is the same thing happening for both anon and logged in users?

stenjo’s picture

Status: Active » Postponed (maintainer needs more info)

I think the user needs to be able to "view own unpublished content" too for this to work. Is this set?
If not, does it fix the problem?

stenjo’s picture

Ah, just realised. The user will be redirected to the faq-page if she does not have permission 'view own unpublished content'. If the permission to view the faq-page is not enabled, then you will have the error you describe here.
She should be able to post a question though. The redirect only happens after question is posted.
Anonymous users are always redirected to 'faq-page' after posting a question:


  // In form_alter hook function
  if (!user_access('view own unpublished content') || ($user->uid == 0)) {
    $form['#redirect'] = 'faq-page';
  }

stinky’s picture

Giving permissions to ""view own unpublished content" didn't help. You can see the behavior on
dev1.library.uaf.edu/faq-page and click "Ask Here"

stinky’s picture

Logged in users can ask a question.

stenjo’s picture

Hm, this is strange. My tests for anonymous user access works fine with the settings you describe. Would it be possible for you to give me a temporary user with access to the permission for this site? That will allow me to investigate further on this spesific issue.
Alternatively as a first step, do a screen dump of the permissions page and the faq settings pages.

stinky’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

I just figured it out. It's a problem with the "related links" module. The "related links" module is messing with all permissions. Disabling this module for FAQs fixed the problem.

stenjo’s picture

Project: FAQ_Ask » Related links
Status: Closed (fixed) » Active

I think we should let the people maintaining the related links module have a chance to look at this issue a little before we close it for good. It might help improve the quality of the module.

-enzo-’s picture

Hello guys.

Attached you can find a patch to resolve this issue, with this change the module will respect if the user have permissions to add/edit/create a node or not, to avoid to present links to create or enable to edit nodes without the proper rights.

The remaining problem is related with combination of permissions, if a content type was enabled to use related links, to add or edit that node the role have to have both permissions add/edit the node and enable to add related links.