Equality, versions, immutability

Simon Brooke 2017-01-02 16:09:58 +00:00
parent 1776e2a212
commit b06f498189

@ -6,6 +6,8 @@ The possible values of that list (and its interpretation) are
* TRUE : every user can access the object; * TRUE : every user can access the object;
* A list : in which case it's equivalent to * A list : in which case it's equivalent to
(member? current-user (flatten acl)) (member? (assoc system.users.user-name current-user) (flatten acl))
The reason for using *(flatten acl)* is that groups of users may be added to access control lists as sublists, recursively. Note that if the sublist of the access control list which contains the current user is not readable by the current user, then the object will not be readable by the current user. The reason for using *(flatten acl)* is that groups of users may be added to access control lists as sublists, recursively. Note that if the sublist of the access control list which contains the current user is not readable by the current user, then the object will not be readable by the current user.
The reason for using system.users.username rather than 'username is that we know the username symbol is interned on system.users.username, and that *member?* uses an *eq?* check to check for membership. At this stage I cannot guarantee that two strings with the same print representation are in fact the same string. I'm not sure that it will ever be worth trying to make that guarantee. So binding the symbol on a well known path is the only way to guarantee we get a *eq?* hit.