Page 1 of 1

Default upload rights for new categories

Posted: 18 Oct 2019, 19:08
by camello
Hi,

My users (members of a club) should be able to create new subcategories, for example for a club event. Then all registered users should be able to upload their photos into this category.
The problem: When someone creates a new category in frontend, only this user has the right to upload into this category.
There is a default setting for access to new categories, but I haven't found a default setting for upload right.

How can I solve the problem?

Best regards
Matthias

Re: Default upload rights for new categories

Posted: 21 Oct 2019, 13:52
by Jan
Hi, yes, as default only the user who made the subcategory has upload rights. To enable it for others, it needs to be set in options. Or all other users get the same user account :idea:

Jan

Re: Default upload rights for new categories

Posted: 21 Oct 2019, 16:24
by camello
Hi Jan,

Thank you for your answer. My users need different accounts, because we also have other services on our website (e.g. a forum).
You can set the default access right for for new categories created at the frontend. But there is no such option to set the default upload and delete right.
Would it be possible to add this feature? Or maybe someone can tell me, in which file I can find the programm code, that sets the upload right to the creator of the new category. Then I could overwrite it.

Regards
Matthias

Re: Default upload rights for new categories

Posted: 22 Oct 2019, 00:24
by Jan
Hi, when you create a category in UCP in frontend, the following controller sets the data:

components\com_phocagallery\controllers\user.php

See function createcategory() cca line 144

and variables like:

Code: Select all

$post['access']
$post['uploaduserid']
$post['deleteuserid']
Jan

Re: Default upload rights for new categories

Posted: 22 Oct 2019, 13:00
by camello
Hi Jan,

I could change the behaviour by using this code in category.php (I don't use UPC):

Code: Select all

$post['uploaduserid'] = $default_accessuserid;
$post['deleteuserid'] = $default_accessuserid;
But I would have to do this changes after every update. Is there a real chance, that a setting for default upload and delete rights could be implemented by developers?

Otherwise I have to find another gallery that supports more detailed rights management. Sad, as I really like Phoca.

Re: Default upload rights for new categories

Posted: 22 Oct 2019, 17:39
by Jan
Hi, the problem is, when such feature will be added into option, there is even no way to add right options there - to fit different needs, so I think, there is no other way as to customize it and make a backup of this file and when upgraded then copy such file :idea: :-(

Jan

Re: Default upload rights for new categories

Posted: 22 Oct 2019, 18:20
by camello
I would solve it the same way as with the default access right. So you can specify in options a default value, e.g. to give upload right only to creator or all registered users.

Re: Default upload rights for new categories

Posted: 22 Oct 2019, 22:06
by Jan
Ok, I have added it to feature request list, but really no idea when I will be able to take a look at it :-(

Jan

Re: Default upload rights for new categories

Posted: 22 Oct 2019, 22:32
by camello
Wow, thank you!