gantry5 icon indicating copy to clipboard operation
gantry5 copied to clipboard

advise to how develop.i want Separate file and folder for user in gantry

Open saman222 opened this issue 2 years ago • 12 comments

hi, i want separate path for upload or delete file via gantry filepicker or any other place that user can upload or view or delete from gantry. now i write the plugin to access each style by set user as admin of each style.but i have another problem each admin can see other admin file's or delete that. 1-Can you say me all way that user can view/upload/delete from inside of gantry? (i think only way is filepicker field. am i right?) 2- Which file should be edited and can you tell me the path for override it?

saman222 avatar Aug 20 '22 08:08 saman222

Unfortunately, setting a custom location for different users isn't possible; it's only possible to customize this by a particle.

mahagr avatar Aug 22 '22 08:08 mahagr

Unfortunately, setting a custom location for different users isn't possible; it's only possible to customize this by a particle.

thank you but i asked reply me to first question. in gantry we only can upload file from filepicker field type?

i am trying to override /public_html/libraries/gantry5/classes/Gantry/Admin/Controller/Json/Filepicker.php for modify upload and view and delete process. am i right?

saman222 avatar Aug 22 '22 08:08 saman222

Yes, but I do not recommend doing that as it'll be overridden upon update.

That said, I would be interested in the change if you can make it work.

mahagr avatar Aug 22 '22 08:08 mahagr

i want create override according to this Doc: https://docs.gantry.org/gantry5/advanced/file-overrides#gantry-directory-structure i must override /public_html/libraries/gantry5/classes/Gantry/Admin/Controller/Json/Filepicker.php and autoloader to register classes in that file. i am trying to do it.

also i created a plugin that i say each gantry style who can access to his style that administrator set that access to each other admin. by this way each admin can access to his menu item style and Gantry has many particle that you don't need use joomla module.

saman222 avatar Aug 22 '22 08:08 saman222

That said, I would be interested in the change if you can make it work. if i override that , even you update gantry, it must be still working. i don't understand your mean

saman222 avatar Aug 22 '22 08:08 saman222

Yeah, override works if you add the overridden file to the autoloader. Just be careful with that override as the classes may change in the future and aren't part of the API (so there's no compatibility requirements). That said, I don't think this file is going to change much.

mahagr avatar Aug 22 '22 09:08 mahagr

Yeah, override works if you add the overridden file to the autoloader.

hi again @mahagr we do that and it is work correctly for me. but i can't understand your mean about autoloder. are you mean add to autoloader.php in JOOMLA/libraries/gantry5/vendor/twig/twig/lib/Twig/Autoloader.php ? if yes how to override in what path? i study the Gantry5 Doc but i can't understand implement. in each way this code is work and you can test it . if you say this is benefit for Gantry5, you can set this code in the core as a new feature and avoid override process. also a suggest is add a setting to Gantry5 component joomla options to set each admin can only access to his file (upload/view/delete). there are three place modified code that start with " // start changes" and end with "// end changes". replace these code with filepicker.php and see the result in gantry5 filepicker field in each gantry template style: filepicker.zip

saman222 avatar Aug 28 '22 08:08 saman222

friendly bump... @mahagr

saman222 avatar Sep 04 '22 11:09 saman222

friendly bump... @mahagr

saman222 avatar Sep 10 '22 12:09 saman222

where are you @mahagr ? we develop part of gantry and wait for your confirmation...

saman222 avatar Sep 18 '22 15:09 saman222

@mahagr @w00fz @coder4life @kevlardev i implemented separate upload space for each user by the file attached , i only need 2 line help from you.

saman222 avatar Oct 16 '22 21:10 saman222

@hexplor please review my code and if it is possible set in gantry. In short, the code that has been sent makes every user who has access to Gantry management only able to see his own uploaded file, and this code makes a folder for each user, and the files uploaded by him are only accessible by him. be Suitable for modes of Joomla sites where several administrators have access to gantry themes.

saman222 avatar May 25 '23 15:05 saman222