Closed (works as designed)
Project:
Userpoints Node Action
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
27 Jun 2012 at 01:05 UTC
Updated:
9 Jul 2012 at 04:12 UTC
Jump to comment: Most recent
Comments
Comment #1
Anonymous (not verified) commentedAs a workaround, you can use the Userpoints Role module (of the Userpoints contrib package). There you can create a role "userpoint owners" and then grant access to the creation form only for this specific role. Has up- and downsides, of course.
Comment #2
peterx commentedI will describe the current use case I am working on. There are others and hopefully other people will contribute their use cases.
We give the user a role when they purchase points and that controls access to the blocks/menus/views of data. They get the role on first purchase and keep the role when they get down to zero points. We need to stop creation when they are at zero but still give them everything else so they can see they are at zero.
We could use Userpoints Role to add an additional role if their points are greater than zero and give create access to the extra role. Installing the whole contrib package for one extra bit is a pain. We already have many roles defined and an extra one is a pain. If we can achieve the same with a few extra lines of code in an existing module, everything is easier including training the staff who will administer it.
I may look at rules for doing something similar to the Userpoints Role module but not today. I will have to leave research until next week.
The ideal would be to have the node add option visible and greyed out with a message about why it is greyed out. Another option would be to have the node add page visible and a big error message about no points with a link to the points purchase page.
Comment #3
BillyMG commentedThis one is a bit tricky because of the way Drupal access controls work. It's much harder to disable access to something than it is to grant access. Because of this, and how every site could be different, it's not really in-scope of this module to do this functionality. However, I've created a function that may help in testing for this condition:
I would recommend you write a custom module that calls this function like so:
This way you can do whatever you need to with the results. Please let me know if you have any questions regarding this, but hopefully it helps.
Comment #4
peterx commentedThank you for the function. For the current project, the requirements simplified a bit, the range of purchase options was reduced, and I found a way to make things work. We will eventually go back to the original workflow because it is easier for some users with some purchases and we will then use your function.
Comment #5
BillyMG commentedSounds good; let me know how it works out. I'll mark this as resolved for now.