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
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top