As far as I see, I have products that assign a role when purchased. When I add the Role Delegate module and assign one of the users (to allow him to change roles of other users), this works as is expected.

However when role product is purchased by an authenticated user, the role is not assigned and the purchase does not work as expected.

If I remove the module everything works, albeit my role admin user, loses the ability to manually set roles.

Any ideas please?

Thank you

Comments

Andrew Schulman’s picture

Assigned: Unassigned » Andrew Schulman
Priority: Critical » Normal

wyattbiker, I'm thinking on this one but it's going to be hard to reproduce and debug. I've never used Ubercart, and I'm not familiar with whatever module you're using to allow people to purchase roles. I guess it's a custom module.

Probably the best I can do is to propose some patches and see if they fix the problem. I'll get to it as soon as I can.

wyattbiker’s picture

I am not sure if the module is custom of the Ubercart. Basically it's part of the Features assignment to the product, to assign Roles once they buy a product.

So here is an example when I assign a feature to a product:

Role assignment SKU: PPROMO-N
Role: Promotional Shopkeeper
Expiration: Tue, 02/15/2011 - 00:00
Shippable: No
Multiply by quantity: No

So anytime someone purchases the SKU PPROMO-N they get the Promotional Shopkeeper.

Maybe the solution would be to have your module detect the source of the assignment. In other words, somehow your module checks the the role of the user and if its not one of the delegation roles it does nothing.

Thanks

wyattbiker’s picture

Andrew Schulman’s picture

OK, thanks. Since I've never used Ubercart, I didn't know that it comes with a uc_roles module. That helps. I'll look at it as soon as I can.

j0nathan’s picture

Subscribing.

Andrew Schulman’s picture

So the failure works like this:

An ordinary authenticated user buys the Promotional Shopkeeper role. uc_roles tries to assign the role. But, Role Delegation intercepts the assignment and blocks it.

There's a genuine conflict here between Role Delegation and Ubercart or other modules that want to allow an ordinary user to assign a role to him or herself. When the user buys that role, UC allows him or her to assign a role to him or herself. Role Delegation doesn't allow that, unless the "assign X role" permission has been granted to all authenticated users.

So I agree that the problem is for Role Delegation to reliably figure out where the source of the role assignment request came from. If it came from Role Delegation, then it can allow or block it. If it came from another module, it should step out of the way.

benjy’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 6 support has now been dropped.