12 replies [Last post]
sprugman's picture
Offline
Joined: 11/26/2007
Juice: 202
Was this information Helpful?

I've created an "editor" role, and checked all four of these:

- administer products
- create products
- edit own products
- edit products

under uc_product module on the Access Control page. However, when I login as an editor, I don't get the edit tab for my products, and if I go to /node/##/edit, I get permission denied.

What am I missing?

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: product edit permissions

About the only thing I can see is the lack of "access content". Not having that permission overrides all of those others you checked.

sprugman's picture
Offline
Joined: 11/26/2007
Juice: 202
Re: Re: product edit permissions

no, that's checked, too.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: Re: product edit permissions

Gosh, I don't know. Double-check everything: editor role really has those permissions, a user really has the editor role, you're really logged in as that user. uc_product_access() looks correct here, and I think it has been for a long time. Check the node_access table, though the logic shouldn't be getting that far for editing.

If nothing else, you can turn on 'administer nodes' to shortcut past all the logic that doesn't work. Of course, you probably have a good reason for not doing that already. :-/

sprugman's picture
Offline
Joined: 11/26/2007
Juice: 202
Re: Re: Re: Re: product edit permissions

turned out that when I manually created the items in the db using sql statements, I accidently assigned a input format that editors don't have permission to use. This led it to disallow editing completely. Interesting....

z3b
z3b's picture
Offline
Joined: 08/15/2007
Juice: 51
Hi Sprungman, Thanks for

Hi Sprungman,
Thanks for taking the time to post the result of your investigation!
Had the same problem when using uc_importer, the "format" value is hard coded to full html.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Hi Sprungman, Thanks for

Ah yes. That's a holdover from when I used it last. Sorry for the confusion. I've changed it now to use whatever the default format has been set to.

kleung11@drupal.org's picture
Offline
Joined: 10/02/2008
Juice: 8
Help needed

I have a similar problem except that it's the opposite. I have set up a role that I do not want the role to be able to create new products. However, this role will be able to create page, events, and book pages. I have all the access control under uc_product module unchecked but yet if I try to login as a user with this role, I am still able to create/edit/delete products.

Is there something I am doing wrong? I tried a fresh install of drupal + ubercart and I can duplicate this problem.

Please help, thanks!

bearstar's picture
Offline
Joined: 05/08/2009
Juice: 41
Thank you

3 hours later after exploring permissions, settings, etc. it turned out to be the input format not having roles assigned.
Thanks very much!

kleung11@drupal.org's picture
Offline
Joined: 10/02/2008
Juice: 8
Re: product edit permissions

Anyone else experiencing this problem or is this a setup that I only see?

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: product edit permissions

If the authenticated user can edit products, then you can't take that away by adding a role.

Give this blog post a read-through: http://gotdrupal.com/videos/understanding-drupal-permissions

kleung11@drupal.org's picture
Offline
Joined: 10/02/2008
Juice: 8
Re: Re: Re: product edit permissions

Thanks for the help. This really gave me an idea but wasn't the reason why this happened that way. The authenticated user doesn't have those permissions at all. The reason was that if "administer node" is given under the node module, then even if all access control under uc_product module is removed, that role will still be able to create/edit/delete any products. This permission seems to give too much control but without it, I can't even see a listing of the other node types I have created and permissions to.

I will research this a bit more. Thanks for the help and guidance.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: Re: Re: product edit permissions

"administer nodes" lets someone see unpublished nodes, and that sounds like the problem you're having. Check the "Publishing options" near the bottom of the node form. You may want to change the default value for these options in the node type settings.