ACL on form fields Topic is solved

For Joomla! 5.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
MarkRS
Joomla! Explorer
Joomla! Explorer
Posts: 348
Joined: Thu Oct 29, 2009 8:28 am
Location: UK

ACL on form fields

Post by MarkRS » Tue Apr 30, 2024 11:47 am

I have fields in a form that I don't want members of some groups to see. Can I control this in the form xml file? If so, how?
It's a community, the more we all contribute, the better it will be.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44150
Joined: Sat Apr 05, 2008 9:58 pm

Re: ACL on form fields

Post by Webdongle » Tue Apr 30, 2024 12:34 pm

In the form (or form override) you could fetch the the group the user is in, then use an if statement to display the field or not?
Or have two forms, one to be seen with one view level and the other to be seen by another. Each could be linked to a menu item with a respective view level?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

MarkRS
Joomla! Explorer
Joomla! Explorer
Posts: 348
Joined: Thu Oct 29, 2009 8:28 am
Location: UK

Re: ACL on form fields

Post by MarkRS » Tue Apr 30, 2024 8:10 pm

I'd like to just exclude some fields, too few to make a completely separate form.
I know how to do it with php in my default.php (or whatever) template, I might even be able to do it with js, I was just wondering if I could do it in the xml form definition.
It's a community, the more we all contribute, the better it will be.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2762
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: ACL on form fields

Post by ceford » Wed May 01, 2024 3:35 am

You might explore what showon will do. You could have a hidden field containing the user group and then use showon="ugroup:nn". This might be insecure - probably better to use in if block in your template php file.


Post Reply

Return to “Joomla! 5.x Coding”