@MeCanX asked me on Twitter how to make a usergroup subscription get hidden, so someone can be given a lower subscription rate.
Well, without lots of fiddling with templates I don't think that's possible, but I can think of a reasonably easy way to make it inaccessible. It just requires some ingenuity.
- Add a new usergroup, "Subscription discounts". Make it hidden.
- Go to view that usergroup, and add the lucky user to it as a secondary membership.
- Add the usergroup subscription.
- Go through to purchase the subscription, getting to the 'message' screen.
- Look at the URL. It will be something like http://baseurl/site/index.php?page=purchase&type=message&id=-1&product=USERGROUP3. Turn this into a match-key, by picking out the distinguishing parts. To do this you need to know how match-keys are composed: zone:page:type[:id]:[something=value:[something=value:[…]]]. In this case we are leaving out the ID because it's irrelevant to this particular match-key, and we have one extra value we tacked on: product=USERGROUP3. In this case it would be site:purchase:message:product=USERGROUP3.
- In the Admin Zone, go to Security, then Match-key restrictions.
- In the first match-key box, paste the match-key (e.g. site:purchase:message:product=USERGROUP3)
- Check (tick) the usergroups you do NOT want to have access. This is all usergroups except "Subscription discounts".
- Paste the match-key in the first "Match-key permission-denied messages" box also, and set a message like "Sorry, this is not a publicly available subscription.".
- Click 'Save'.
You will now find nobody but admins and the "Subscription discounts" user(s) can access the usergroup subscription without seeing the "Sorry, this is not a publicly available subscription." error.
Was I helpful?
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about ocPortal whenever you see the opportunity.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.