default permission level when admin uploads files

Phoca Download - download manager
caliber
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 27 Nov 2015, 02:48

default permission level when admin uploads files

Post by caliber »

how can i set the default user level to "registered" when an admin uploads a file in the admin side of the website. We have many admins uploading and this is a common step that is missed. Is there a way to set it so any file is set to registered by default instead of public?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: default permission level when admin uploads files

Post by Jan »

Hi, when the file is uploaded and added in file edit, then you can set the rights directly there.

When the files are uploaded and added by multiple add function, there is no option to set rights, so this needs to be customized:

- to add the form of access rights
- and to manage it in controller and model when the form is sent

Image

Jan
If you find Phoca extensions useful, please support the project
caliber
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 27 Nov 2015, 02:48

Re: default permission level when admin uploads files

Post by caliber »

we are looking to have it so that when an admin uploads from the admin of the site. When uploading a new document it is "registered" by default so t hat they do not have to choose the drop down to make it registered. Is there no way to do this?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: default permission level when admin uploads files

Post by Jan »

Hi, then you can set id directly in the code - 1 or 0 (depends on your needs) which will be set directly - without using the form select box :idea:

Jan
If you find Phoca extensions useful, please support the project
caliber
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 27 Nov 2015, 02:48

Re: default permission level when admin uploads files

Post by caliber »

what i am trying to accomplish is that when an admin or manager created a new file that the only access levels available is registered. Or i want to make registered default instead of having public default. We are trying to make it so that any manager creating a new file cannot accidentally have it set to public.
I have been unsuccessful in finding what file to edit to accomplish this.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: default permission level when admin uploads files

Post by Jan »

Hi, so instead of adding a select box - to check if the file will be for registered or public, you can set it directly in the code - so when uploading a file, the file will be directly set e.g. to registered and the one who uploads, do not change anything :idea:

Jan
If you find Phoca extensions useful, please support the project
caliber
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 27 Nov 2015, 02:48

Re: default permission level when admin uploads files

Post by caliber »

I see someone else is trying to do the same thing and doesnt appear to work.

http://forum.joomla.org/viewtopic.php?f=727&t=904156
I need to set a default value for the accesslevel in my code (not in admin panel) however when I add it, it does not work

Code:
<field name="access" type="accesslevel" default="2" label="JFIELD_ACCESS_LABEL" description="JFIELD_ACCESS_DESC" class="inputbox" size="1" />


If I do this, it does not work too!
Code:
<field name="access" type="radio" default="2" label="JFIELD_ACCESS_LABEL" description="JFIELD_ACCESS_DESC" class="btn-group btn-group-yesno">
<option value="8">Clients</option>
<option value="5">Guest</option>
<option value="1">Public</option>
<option value="7">Staff</option>
<option value="6">Super Users</option>
<option value="2">Registered</option>
<option value="3">Special</option>
</field>

any guidance on how to update the code would be greatly appreciated
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: default permission level when admin uploads files

Post by Jan »

Hi, it depends where you add this code, if e.g. in frontend upload and there is no such code before, the controller and model needs to be customized too, so it can get this value (controller), manage it (controller) and store it to database (model)

Jan
If you find Phoca extensions useful, please support the project
Post Reply