• Payment Plugins Poll

    We need your feedback on the need for updated payment plugins. Please go here and give us your feedback.

  • Joomla 5.1

    For running J!5.1 you must install Fabrik 4.1
    See also Announcements

  • Subscription and download (Fabrik 4.1 for J!4.2+ and J!5.1) are working now

    See Announcement
    Please post subscription questions and issues here

    We have resolved the issue with the J! updater and this will be fixed in the next release.

Validation for user groups

jubranz

New Member
Can I make some elements mandatory for some user groups or access level and optional for others?
 
you can add php code in 'Condition'.
Returning false will skip the validation.

Gesendet von meinem SM-G930F mit Tapatalk
 
To run the validation only for people not in access level 123 ...

Code:
$myLevels = $this->user->getAuthorisedViewLevels();
return !in_array(123, $myLevels);

Or ... to run it for people in levels 123 and 124 ...

Code:
$myLevels = $this->user->getAuthorisedViewLevels();
return in_array(123, $myLevels) || in_array(124, $myLevels);

Similar things for group, but to get the groups ...

Code:
$myGroups = $this->user->getAuthorisedGroups();

-- hugh
 
Back
Top