Catalogue perms

Post

Posted
Rating:
#5698 (In Topic #1327)
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
I have a database of things inside a catalogue category. I am aware of being able to restrict usergroup access to the category itself, but I was hoping to restrict access to specific entries depending on the USERGROUP (I want to grant complete access to the category though). Currently, the only permission levels to select from restricting access to individual entries are: everyone, members only, friends only, myself only.

Is there a work-around for this?
Online now: No Back to the top

Post

Posted
Rating:
#5699
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
If there isn't a simpler way, I thought about just creating a custom field (multiple values chosen from a list) that would enable me to select which groups could view, then modify the catalogue template to check if the user is in a permissible group.

But I'm wondering if there would be any performance disadvantages to doing it that way? Plus I'd have to hard-code the usergroups in the custom field…it'd be a dirty workaround.
Online now: No Back to the top

Post

Posted
Rating:
#5704
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
You'll have to do some kind of workaround, as I don't we'll be supporting that anytime in the future for performance and UI overhead reasons.

One possibility, are you able to enable "Narrow-in when browsing" for catalogues? That way you can put things in subcategories, and have them display in the parent category according to the permissions on the subcategory.
I think this is a global setting that affects all categories, so that may be an issue, but it may be you can search the code for where this setting is applied and alter it a bit – maybe it could even be made to only run on certain category views.

Otherwise I think some kind of Tempcode workaround would be needed. I don't think it would hurt performance much. You could make a field that was interpreted as Selectcode, then use the IS_IN_GROUP against it.

Something like:

Code

{+START,IF,{$OR,{$IS_EMPTY,{FIELD_17}},{$IS_IN_GROUP,{FIELD_17}}}}
...
{+END}

Where the inputted value is something like 1-8,9-13

Or you could introduce a level of indirection…

Code

{+START,IF,{$OR,{$IS_EMPTY,{FIELD_17}},{$AND,{$EQ,{FIELD_17},free_users},{$IS_IN_GROUP,1-8,9-13}},{$AND,{$EQ,{FIELD_17},free_trial_users},{$IS_IN_GROUP,14,15}}}}
...
{+END}

Where the inputted value is a value like free_users.

(I didn't test any of the above code)


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

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 Composr whenever you see the opportunity or support me on Patreon.
  • 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 Composr 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.
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

Manu, MVLipwig, mytracker, deepu_ms, Paul D, Vaiva, gabriel58

Forum statistics:
  • 1,084 topics, 5,240 posts, 6,123 members
  • Our newest member is salesvu1981
Birthdays:
Back to Top