I allowed the "authenticates users" role to "ask question". When a simple authenticated user go to node/add/faq?ask=true he gets access denied.

Comments

claudiu.cristea’s picture

I assume that this should be enough... The standard FAQ module "create faq" permission is not something that I want to give to "authenticated users"...

orces’s picture

I have the same problem after taking all the steps here:
http://drupal.org/node/266823

claudiu.cristea’s picture

There is a faq_ask_access() hook defined in the module, but this function is not called.

This is a blocker issue..

orces’s picture

So how should this be solved?

claudiu.cristea’s picture

Downgrading to 6.x-1.x solved the issue... It's a 6.x-2.x issue...

ycwjjjj’s picture

same issue I encountered

jim.tank.jr’s picture

SOLUTION OR WORK AROUND:

To allow users to Ask Questions, you must grant BOTH of the following permissions:
1. faq module.create faq
2. faq_ask.ask question

ycwjjjj’s picture

I tried to grant both of the permissions. However, the user of the granted role can also create a FAQ with answer field if they create new content of FAQ content type. It seems not the way we want to allow it happen.

jriedel’s picture

Subscribe.

I want anonymous people to ask a question, setting the permission needed means an anonymous person can not only ask, but gets a create content menu item as can creata faq and asnwer it at the same time.

It worked fine in the previous versions.

dpatte’s picture

subscribe

stenjo’s picture

A workaround for me was allowing create faq to anonymous users and then hide the create content menu item. The url still works from ?q=node/add/faq but you have to know about it and type it directly. May not be a good solution if you have a lot of users who should be able to create faq's outside FAQ-Ask but it works for me. This link can be bookmarked for those who should have the right to create pure FAQ nodes.
/Sten

stenjo’s picture

Version: 6.x-2.0-alpha1 » 6.x-2.x-dev
Assigned: Unassigned » stenjo
Priority: Critical » Minor
Status: Active » Postponed

With the workaround in #11 and the fact that this is related to #580592: Ask question needs create FAQ permission, this is no longer a critical issue.
There will probably not be a solution to this until there is a major rewrite involving a separate temporary content type for questions.

stenjo’s picture

Status: Postponed » Fixed

With the workaround in #580592: Ask question needs create FAQ permission this issue is closed.

escoles’s picture

Shouldn't the status be 'postponed' rather than 'fixed'? The problem is not fixed, it's merely worked-around (and in a risky way).

soelver’s picture

I really don't see this as a solution.
Yes, it works, but it's not right to do it that way.

Hoping for a real fix :)

stenjo’s picture

Status: Fixed » Postponed

Yes, you are right.
As long as this being a workaround, it is not fixed.

sdsheridan’s picture

Subscribe.

nitebreed’s picture

Subscribing

tobedeleted’s picture

It strikes me that without a proper fix to this issue this module is essentially broken, as I would imagine that a pretty common use case will enable anonymous users to ask a question, and I would guess that the vast majority of site owners will not wish to give these users rights to create an FAQ.

stenjo’s picture

Assigned: stenjo » Unassigned

I was hoping to find some time to implement a proper solution to this involving a separate intermediate content type for unanswered questions so that this problem will be taken care of.
It does not seem to be happening any time soon, so there is no reason why this issue should be assigned to me.
The module is in use at my own site with the current flaw - using workarounds. I guess the itch is not strong enough for me yet...
Please, any patch are welcome.

tryitonce’s picture

... not very satisfactory the current status of the problem. I just spent quite a bit of time trying to fix it along the described lines here.
Then this happened on testing:

  1. multi-lingual site
  2. authenticated user calls faq_ask
  3. faq_ask opens just with the short & extended question
  4. authenticated user changes the language (en to de) during editing 7 adding the question
  5. ... and up comes the whole faq edit page with the answer wide open.
  6. ... not funny .....

Solution: bin the faq_ask module??????????????
What a pity - such a nice module - great idea and so useful ................ very sad, indeed.
..........

kcarwile’s picture

I took a somewhat simpler way to fix this problem. Essentially, the node form should ALWAYS be configured to "ask a question" when somebody has the 'ask question' permission set... otherwise why would you set that permission?

To fix this problem, give your appropriate roles the 'create faq' and the 'ask question' permissions. Then add the following lines of code to faq_ask.module after line 164:

global $user;
if ($form_id == 'faq_node_form' && user_access('ask question', $user)) $_GET['ask'] = 1;

The result is that a user with the 'ask question' permission is always going to get the "ask a question" version of the node creation form.

jlea9378’s picture

The fix in #22 works a little TOO well. It applies to everyone since admins and experts are considered authenticated users and I have given anonymous and authenticated users the right to ask questions. A better fix would be:

  global $user;
  if ($form_id == 'faq_node_form' && user_access('ask question', $user) && !user_access('answer question', $user)) 
    $_GET['ask'] = 1;

This excludes everyone who has the Answer Question permission.

stenjo’s picture

Version: 6.x-2.x-dev » 6.x-2.1

The issue in #21 is reported as a critical bug in #1052772: Removing "?ask=TRUE" from url let's user enter complete FAQ entry. Follow this for further comments.

tryitonce’s picture

.... thanks for the link ....

tryitonce’s picture

.... thanks for the link ....

olezhek’s picture

jlea9378
Didn't help me. It still says that anonymous user has no permissions to add a question.

jlea9378’s picture

Do you have your permissions set properly? I have mine set so that:
Anonymous users can "Ask Question"
Authenticated users can "Ask Question"
Nobody else can (but they can create FAQ nodes)

nancydru’s picture

Those two roles cover everybody.

jlea9378’s picture

You're right. My change to the code excludes people with the answer permission though.

olezhek’s picture

jlea9378
Thanks for your answer.
Yes, it was my mistake. I didn't set up permissions properly for the FAQ module.

stenjo’s picture

Seems like this issue will be better addressed in the upcoming D7 version as the permissions are finer grained and allows more control. Please help out testing the new dev version of this and it'll get there quicker :-)

stenjo’s picture

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

Moving this to D7 as I don't see it will be fixed in D6

stenjo’s picture

Assigned: Unassigned » stenjo
Status: Postponed » Needs review

Seems like the original issue of this thread is resolved in D7?

tryitonce’s picture

That would be rather disappointing. D6 will be around for quite some time to come.
With Drupal improving D6 has a much wider base than D5 and thus will be around for much longer with less need to upgrade ....

nancydru’s picture

@tryitonce: But the noise from people wanting D7 support is drowning out the D6 people. I won't rule out this getting into D6, especially when it seems to be in D7. But you also have to realize that we maintainers are volunteers - we don't get paid for this, but our landlords still want their money on time.

stenjo’s picture

Status: Needs review » Fixed

This is getting a little blurry for me. Currently in FAQ Ask 6.x-2.2 it works like this:

If Anonymous users should be able to create unanswered questions then,

  1. The permission to Anonymous users must be set to both create faq and ask question
  2. The asker url is http://example.com/faq_ask, that is redirected to http://example.com/node/add/faq?ask=1 and will give the user a question form without the answer field visible.
  3. If the user tries to access http://example.com/node/add/faq, he will be redirected to http://example.com/node/add/faq?ask=1 and have the same forma as above.
  4. If a user with answer question permission goes to http://example.com/node/add/faq?ask=1 he will also not have the answer field but http://example.com/node/add/faq will reveal the answer field for the answer question user.
  5. The Add content wil ONLY have a FAQ part as this is the only type of content Anonymous user is allowed to create. Hitting that menu item results in the same question form without the answer field as in 2 above.

The same applies to registered user with same permissions set.
Seems pretty watertight to me. Have I missed something?

In any case, this is not an issue in 7, so I'm closing this thread.

If there is an issue with the D6 still, I hope someone can add that to the issue queue for the correct D6 version of FAQ Ask, remembering to provide a good explanation why this might still be a problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ditcheva’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha1
Status: Closed (fixed) » Needs review

I'm not sure why this was marked as 'fixed' above. I'm definitely still seeing the problem behavior in the 7.x version...

I definitely don't want to give 'create FAQ' permissions for those who are allowed to ask. The permissions to write FAQs will be given to a much, much smaller group of users.

I'm re-opening this because I don't believe it has been fixed yet. If I'm mistaken, just let me know. I'm using the latest recommended release.

p.s. I really like this module, by the way!

stenjo’s picture

Status: Closed (works as designed) » Needs review

Im not getting what the problem behaviour really is at this point. If you read my comment #37 I'm explaining how I understand the modules behaviour now.
How would you NOT give 'create FAQ' to people who are asking questions? The question is part of the FAQ entry and with the more granular permission settings in D7 that should not be a problem the same way it is in D6.
Keep in mind that even if you are allowing someone to create an FAQ, the node is not published unless an author "expert" touches it.

jlea9378’s picture

I agree with Sten. It seems to work perfectly fine and logically in all of my tests.

ditcheva’s picture

Status: Needs review » Closed (works as designed)

Hmmm, yes. I see your point! The name of the permission makes it difficult for a new user to want to give to those asking for faqs rather than creating them, but I do understand your point and why that's necessary. Sorry for prolonging the thread! I'm closing it.

jlea9378’s picture

Status: Needs review » Closed (fixed)