Default upload rights for new categories

Phoca Gallery - image gallery extension
camello
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 18 Oct 2019, 19:00

Default upload rights for new categories

Post 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

Tags:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Default upload rights for new categories

Post 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
If you find Phoca extensions useful, please support the project
camello
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 18 Oct 2019, 19:00

Re: Default upload rights for new categories

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Default upload rights for new categories

Post 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
If you find Phoca extensions useful, please support the project
camello
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 18 Oct 2019, 19:00

Re: Default upload rights for new categories

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Default upload rights for new categories

Post 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
If you find Phoca extensions useful, please support the project
camello
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 18 Oct 2019, 19:00

Re: Default upload rights for new categories

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Default upload rights for new categories

Post 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
If you find Phoca extensions useful, please support the project
camello
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 18 Oct 2019, 19:00

Re: Default upload rights for new categories

Post by camello »

Wow, thank you!
Post Reply