Prevent changing created_by if the current user is not allowed to access to com_users

This commit is contained in:
Tuan Pham Ngoc 2021-08-27 10:38:45 +07:00
parent fc4267038c
commit c70b2f70b0
1 changed files with 6 additions and 0 deletions

View File

@ -155,6 +155,12 @@ class WeblinksModelWeblink extends JModelAdmin
$form->setFieldAttribute('publish_down', 'filter', 'unset');
}
// Don't allow to change the created_by user if not allowed to access com_users.
if (!JFactory::getUser()->authorise('core.manage', 'com_users'))
{
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
return $form;
}