Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 2181

Joomla! 5.x Coding • Re: How to check if user is admin in an article.

$
0
0
Yes, it does depend upon how what exactly you mean by 'admin' and how you've configured your site.

The list of administrator-like permissions is given in the Permission Actions section at https://manual.joomla.org/docs/general- ... ermissions so you can use $user->authorise() to check for any of these.

Also the administrator back-end can be viewed only by people with the Special access level. So another possibility would be to use

$levels = $user->getAuthorisedViewLevels();

and check that the id for Special is in the returned $levels, as described in https://manual.joomla.org/docs/general- ... acl-access

Statistics: Posted by robbiej — Wed Jul 03, 2024 8:21 am



Viewing all articles
Browse latest Browse all 2181

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>