HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Using match-key permissions, an example

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#53151 (In Topic #11579)
Avatar

@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.

  1. Add a new usergroup, "Subscription discounts". Make it hidden.
  2. Go to view that usergroup, and add the lucky user to it as a secondary membership.
  3. Add the usergroup subscription.
  4. Go through to purchase the subscription, getting to the 'message' screen.
  5. 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.
  6. In the Admin Zone, go to Security, then Match-key restrictions.
  7. In the first match-key box, paste the match-key (e.g. site:purchase:message:product=USERGROUP3)
  8. Check (tick) the usergroups you do NOT want to have access. This is all usergroups except "Subscription discounts".
  9. 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.".
  10. 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.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
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.
Back to the top
 
Posted
Rating:
#53163
Avatar

Fan in training

Excellent!

Thank you much!

It's a bit tricky but I think I can figure it out.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: