Joomla Asked by Thiago Guimarães on July 21, 2020
I would like to know how I upload files to a specific folder through Joomla Administrator Panel (My Component Backend).
I know how to do it in the site part following along with this tutorial:
However I don’t know how to do the same thing in the backend part.
I have this in my controller
file to edit and add a new image:
protected function allowAdd($data = array())
{
return parent::allowAdd($data);
}
protected function allowEdit($data = array(), $key = 'id')
{
$id = isset( $data[ $key ] ) ? $data[ $key ] : 0;
if( !empty( $id ) )
{
return JFactory::getUser()->authorise( "core.edit", "com_gallery.image." . $id );
}
}
I could use my own code inside these functions but I think I won’t be able to check if the user has permissions to execute these actions. I’m not sure what JFactory::getUser()->authorise()
is for but I think it authorises the user to perform actions when they have permission to do so.
So my question is:
Is there any way to use my own upload code and check whether the user has permissions to execute that action or not?
0 Asked on September 5, 2021 by laiozatt
1 Asked on September 5, 2021
1 Asked on September 5, 2021 by eoin
1 Asked on September 5, 2021 by semaphore
1 Asked on September 5, 2021 by askerman
1 Asked on September 5, 2021 by viktoriia-shestak
1 Asked on September 5, 2021 by huub-s
2 Asked on September 5, 2021
1 Asked on September 5, 2021 by rhea-lorraine
1 Asked on September 5, 2021 by astridx
1 Asked on September 5, 2021 by bilal-kabeer-butt
1 Asked on September 5, 2021 by giovanni-de-maria
1 Asked on September 5, 2021 by ta1982
2 Asked on September 5, 2021 by mishulo
1 Asked on September 5, 2021 by irata
2 Asked on September 5, 2021 by shenkwen
1 Asked on September 5, 2021 by theroyality
Get help from others!
Recent Questions
Recent Answers
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP