Récupération de privilège dans un Controller
Réduire
X
-
Ton domaine de nom n'a certainement pas été défini au début du script.
Voir la discussion sur les namespaces.
Sinon tu peux aussi utiliser :
Code PHP:\Joomla\CMS\Factory::getUser()->authorise('comment.edit','com_nglibrary');
Voir : https://ordi-genie.com/joomla/develo...partir-de-j3-8
Laisser un commentaire:
-
Problème réglé.
\JFactory::getUser()->authorise('comment.edit','com_nglibrary')
Laisser un commentaire:
-
Récupération de privilège dans un Controller
Bonjour,
Comment récupérer le niveau de privilège dans le controller : JFactory::getUser()->authorise ne fonctionne pas.merci pour votre aide.public function save() {
if (JFactory::getUser()->authorise('comment.edit','com_nglibrary')) : //si l'utilisateur est connecté en admin
parent::save();
else :
$sendcomment = new \Nglibrary\Admin\Controller\Comment($this->container);
$sendcomment->sendComment(); parent::save();
endif; }
Tags: Aucun
Annonce
Réduire
Aucune annonce pour le moment.
Laisser un commentaire: