4

I am getting the following error:

The document could not be saved. You don't have permission

The error is not helpful at all because it does not point to where I don't have permission. To save the file, I need to Duplicate it each time, which is very painful. This time the error is from CleanWriterPro, but I have also received it from Numbers and TextEdit. Saving with TextMate works fine.

Permissions to the file are set up correctly according to Finder.

I think this must be some kind of problem with AutoSave permissions but despite googling with the error, I have not yet figured out what's wrong.

I found one possible culprit for this problem for me:

grant:Library joneskoo $ pwd
/Users/joneskoo/Library
grant:Library joneskoo $ ls -lad Autosave\ Information/
drwx------  2 root  staff  68 Sep 25  2010 Autosave Information/

Since Library is hidden in Lion, it needs to be made visible before the permissions can be fixed in Finder:

chflags nohidden ~/Library

After unhiding the Library, I opened the Get Information for Library, clicked the lock and selected "Apply to enclosing items" so that all files in Library made owned by me and no permissions for others.

However, CleanWriterPro is still not able to save the file in Documents, even though I repeated the step for Documents and Desktop. I could not reproduce the problem in Numbers now.

Repairing Disk permissions did not help.

Possibly related: I can't even rename files in Finder now under Documents without typing my password. Techrepublic: Introduction to OS X access control lists.

grant:~ joneskoo $ ls -led Documents/
drwxr-xr-x+ 44 joneskoo  staff  1496 Jan 17 06:55 Documents/
 0: group:everyone deny delete

I don't know what introduced that ACL, Finder? How can I remove it?

The question is: what are all the places I need to check to fix this problem?

  • There is something weird going on my with my Documents permissions now; even though I'm the owner, I need to type my password even to rename files in Documents. Unix permissions are fine. – joneskoo Jan 17 '12 at 5:00
  • The problem was extended ACLs. chmod -R -N Documents fixed the problem for CleanWriterPro. – joneskoo Jan 17 '12 at 5:25
  • I think I have figured where this problem originated. I created a new folder Foo and gave it chmod +a "everyone deny delete" Foo. I put one test file in the folder. Then I opened Finder, clicked the lock and "Apply to enclosing items". That actually copied the ACL to the test file => I could no longer rename that file. So APply to enclosed items is DANGEROUS and should not be used for Documents, Library or other special folders in Lion. – joneskoo Jan 17 '12 at 5:52
4

I was able to fix the problem for CleanWriterPro by removing extended ACL from the affected directories (Documents, Desktop):

$ chmod -R -N Desktop Documents

For others with the same problem, I'd suggest checking the permissions of at least the following places:

  • ~/Library/Autosave Information
  • ~/Library/Containers – see Unsaved Files in OS X Lion
  • the folders containing the problematic files

Use the command

$ ls -le Documents

to show also the extended ACLs when looking at the problem. Finder will not show all ACL information.

There is a related discussion at Apple Discussion Forums, Lion Permissions Problem. It proposes the solution of removing all ACL from home directory and restoring the ACLs for some default folders. Please read the entire post from there; but the commands are:

chmod -R -N ~
chmod +a "everyone deny delete" ~/ ~/Desktop ~/Documents ~/Downloads ~/Library ~/Movies ~/Music ~/Pictures ~/Public

The ACL prevents the user from deleting or renaming the default folders.

An unintuitive but maybe safer(?) alternative is described at OS X Daily: Repair user permissions in Mac OS X Lion

  • Accepted my answer, it did work. I did not verify the resetpassword based solution in OS X Daily, but it seems like it could do the job, too. – joneskoo Apr 9 '12 at 18:54
3

I have encountered this problem twice for TextEdit, on OS X Lion, and rebooting the computer fixed the problem both times.

Sorry that I can't give you anything more profound, but there you go.

  • I have a friend who has encountered this problem a couple of times. He gets/creates a lot of .RTF files. They stay open in TextEdit (more than 20!) for many days. We were able to get past the problem by restarting TextEdit (after copying unsaved items and saving in another program). – marklark Jan 4 at 18:23
  • I am having issue where .rtf files are becoming locked on mojave (check box is not checked) and restarting does not fix it. – user2568374 yesterday
1

Have you tried turning it off and turning it on again? (I.e. restarting the offending program.)

It worked just now for a friend of mine. I asked him to do it while I was here researching -- and it worked.

YMMV, of course.

  • This is a valid, working answer (as well as a decent joke (see "The IT Crowd")). It doesn't deserve a down-vote. I didn't expect any up-votes, but... – marklark Oct 12 '16 at 21:43
  • 1
    upvote for you then from me. This was in fact the only suggestion that worked for me. – dland Mar 6 '17 at 16:13
  • I didn’t downvote, but this answer seems similar to mine. – Andrew Grimm Jun 4 '18 at 22:16
  • @AndrewGrimm - I should have been more clear. Restarting TextEdit solved the problem. – marklark Jan 15 at 18:50
0

First, I'd recommend looking at the permissions on the folder containing the file in question.

Second, a tool that might help you is the Repair Permissions function in Disk Utility. This might find and repair what is wrong with your system. enter image description here

  • I just repaired disk permissions, but that did not help CleanWriterPro. I had performed that earlier to try to fix Numbers but it didn't help there. – joneskoo Jan 17 '12 at 4:50
  • OK, trying another answer. Sorry this one didn't help. – Daniel Jan 17 '12 at 4:58
  • This option has been removed in more recent versions of Macos (Sierra at least). – dland Mar 6 '17 at 16:30
0

To remove any ACLs and restore all the files in your home directory to be owned by you, you can run the following commands in Terminal:

 sudo chown -R `whoami` ~
 chmod -N -R ~

This should ensure you have access to all your files. Some ACLs are in place by default, however, to prevent you from deleting your Documents folder, Music folder, etc., and to enable other users to access your Public folder. While all these folders were able to serve their function in versions of OS X that predate ACLs, removing the ACLs should fix the access problems you are encountering, but might make your Public folder behave differently than expected.

  • I think the extended ACL is the remaining problem. Finder fixed the Unix permissions (chown) but not the extended ACL. – joneskoo Jan 17 '12 at 5:07
  • I was able to fix the problem by removing extended acl with chmod -R -N Documents Desktop. I need to wait 7 hours before I can post the answer (site restrictions). Your answer is directed to me but does not answer to the generic problem. I'm sure others will run in to this. The answer has to list which places need to be checked for ACL and permissions. – joneskoo Jan 17 '12 at 5:23
  • I have now posted my self-answer. I think it's relevant to include instructions to fix the default ACLs you mention. I don't know if the delete preventing ACL is the only one set up by default but that's what I found in the article I linked. – joneskoo Jan 17 '12 at 18:21
0

To make one of the possible issues clear, under Lion the Disk Utility does not repair user home directory file permissions. The process linked at the end of the first answer -- Repair user permissions in Mac OS X Lion is a simple and direct way to reset user permissions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .