Folder permissions

55 views
Skip to first unread message

Arbee

unread,
Sep 3, 2017, 1:46:53 PM9/3/17
to SilverStripe Core Development
Hi, I am working in ss 3.6 with the forum module. I cannot seem to change the permissions for the forum/attachments folders which are in the assets folder. Can anyone guide me in the right direction as to how to set these to Write?

Thanks in advance!

Patrick Nelson

unread,
Sep 3, 2017, 4:04:38 PM9/3/17
to silverst...@googlegroups.com
Where are you trying to change permissions from? e.g. From within the CMS in the files/assets module, from the forum module, or possibly from SFTP/SSH? Technically you can also change permissions on the file system itself (e.g. chmod), but that's probably obvious. But, in case it is not: It's possible that your web server is running as a user (e.g. 'apache') that you aren't able to change once uploaded (e.g. 'ruth') unless you were to login as root or be part of the same group as the apache user (depending on the actual file permissions).

Also: I assume you're logged in currently as an admin, is that correct?

Disclaimer: I've never used the forum module :D 

On Sun, Sep 3, 2017 at 10:46 AM, Arbee <ru...@arbeedesigns.com> wrote:
Hi, I am working in ss 3.6 with the forum module. I cannot seem to change the permissions for the forum/attachments folders which are in the assets folder. Can anyone guide me in the right direction as to how to set these to Write?

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-dev+unsubscribe@googlegroups.com.
To post to this group, send email to silverstripe-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/silverstripe-dev.
For more options, visit https://groups.google.com/d/optout.

Arbee Designs

unread,
Sep 4, 2017, 12:35:39 AM9/4/17
to silverst...@googlegroups.com
I was trying to change it in the forum module, but it doesn't matter where as long as I can change it. I also tried in cPanel to no luck. 

Yes logged in as admin.



--
You received this message because you are subscribed to a topic in the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/silverstripe-dev/Ffm3PUvIKeg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to silverstripe-dev+unsubscribe@googlegroups.com.

Patrick Nelson

unread,
Sep 4, 2017, 7:48:32 PM9/4/17
to silverst...@googlegroups.com
Ok, so it suggests to me that the permissions issue you're talking about is file system permissions (i.e. on Linux itself), not CMS permissions. I wanted to hash that out since it can get a little technical. The phrasing of the issue is somewhat ambiguous, so figuring out what the problem is, is itself, a mystery sometimes. So -- the solution here is to know the following (you need to know and answer each of these):
  1. How do you access the file system itself? e.g. Do you use SFTP or SSH (noted above) or something else?
  2. What is the (Linux) user and group that your web server runs as? e.g. "apache" or "nobody" (noted above). 
Once you find that out, you'll then know (correspondingly) how to do the following:
  1. How to set permissions.
    • If SSH: Login to the host, CD to the assets directory and use the 'chmod -R [some number, noted below] assets/' command (hinted at above)
    • If SFTP: Login to the host, find the assets directory, right click and set permissions 
  2. What permissions to set on the 'assets' directory (and subdirectories)
    • e.g. If the web server runs as 'apache', you can have more restrictive permissions (i.e. no need for world read/write/delete permissions)
    • e.g. If the web server runs as 'nobody' you have no choice but to set very loose/insecure permissions on the folder (which I don't want to recommend unless necessary)
And in any scenario on permissions, it's usually not a bad idea (in my opinion) to use the setguid, but let's figure the first two out, first.



Arbee Designs

unread,
Sep 5, 2017, 2:57:25 AM9/5/17
to silverst...@googlegroups.com
Thanks for your help Patrick, but something seems to be amiss.

Ok, I use SFTP and apache.

I have already attempted to right click on directory to set permissions.... this is how I normally do it and have in the past. The problem is, it doesn't stick. It just resets itself back to the 'write' being unchecked.

I'm not sure if this has anything to do with the problem.... but in the forum module, you cannot overwrite an uploaded image, but it appends a number on the end of the file name if there happens to be another of the same name... makes sense as lots of users upload in the forum. But as admin, I want to be able to overwrite the image when I need to.

I believe it is something to do with the module. It is only the folders for the forum module which are located in the assets folder.

I don't know if that sheds any light on the situation or not.

Patrick Nelson

unread,
Sep 5, 2017, 5:19:30 AM9/5/17
to silverst...@googlegroups.com
Now I think we've arrived at the real issue you were contacting the list about in the first place. In that case, the best solution would be to just submit an issue on the Github page for the module and submit a feature request (submit an issue). In this case, you just ask for the ability to do exactly this. Just be explicit in your situation/conditions on how/when you have the ability to overwrite and change files based on the various contexts (e.g. Users vs. admin, which areas and where, etc).

The "write" permission is unrelated. If it is there from uploading through the forum/CMS, clearly the permissions are fine. It was created/written initially because the web server is the owner, but owner/group/everyone permissions may vary (owner can always still create a file even if the file's write permission isn't enabled since the permissions are set after creating).

Sent from my iPad

Arbee Designs

unread,
Sep 5, 2017, 2:59:25 PM9/5/17
to silverst...@googlegroups.com
Thank you so much for your help Patrick! It is very much appreciated. I will go put in that request.



Reply all
Reply to author
Forward
0 new messages