On Jan 6, 2012, at 7:05 AM, Luther Fuller wrote:
Here's the problem ...
User "B" is logged in and, via an AppleScript, wants to get the privileges assigned to him by user "A".
As far as I can determine, this is impossible.
The script can ask for the 'owner' of the item --> "A",
and can ask for the owners privileges,
but I can find no command in AppleScript which can
1. ask if "B" is an assigned user of the item; and
2. ask for the privileges of user "B".
Does anyone know how to do this?
Eg. Permissions.txt, created and owned by user_a
2820-mp:~ user_a$ ls -le permissions.txt
-rw-r--r-- 1 user_a user_group 0 Jan 6 09:17 permissions.txt
There are no ACL's on the file, so it's straight unix permissions.
Suppose, further, that user "A" adds user "B" to the item and sets privileges for that user.
When that happens, that goes beyond unix permissions and it is now an ACL on the file. After adding read privileges for User B, this is what it looks like using ls.
2820-mp:~ user_a$ ls -le permissions.txt
-rw-r--r--+ 1 user_a user_group 0 Jan 6 09:17 permissions.txt
0: user:user_b allow read,readattr,readextattr,readsecurity
And if I add Read & Write permissions from the get info window, it looks like
2820-mp:~ user_a$ ls -le permissions.txt
-rw-r--r--+ 1 user_a user_group 0 Jan 6 09:17 permissions.txt
0: user:user_b allow read,write,append,readattr,writeattr,readextattr,writeextattr,readsecurity
So perhaps you can get the proper permissions info from ls?