Catalogue perms
Posted
#5272
(In Topic #1063)
Is there a work-around for this?
Posted
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
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)
2 guests and 0 members have recently viewed this.
