Catalogue perms
Posted
#5698
(In Topic #1327)

Standard member

Is there a work-around for this?
Posted

Standard member

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

Site director

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 Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- 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.
1 guest and 0 members have just viewed this.