views:

59

answers:

4

I have a class to store unix-like permissions for user, group and other. In principle it is a limited access control list but I don't want to name it ACL, because usually an ACL is something different.

The class looks basically like this:

class X {
  boolean userRead, userWrite, userExecute;
  boolean groupRead, groupWrite, groupExecute;
  boolean otherRead, otherWrite, otherExecute;
}

How to name a class like this? What is the name in Unix?

A: 

It looks like it deals strictly with file permissions, so what about calling it FilePermissions?

James McLeod
It is not limited to files. A secured object could also be a row in a data base table. But maybe simply "Permissions" would be a good name.
deamon
+3  A: 

Often for such questions, the answer is in the question. I would call it Permissions with a comment above saying "Unix-like permissions for user, group, and other".

Michael Easter
UnixPermissions would be a better name, since permissions on Windows work differently (this is a java class, right?).
Ken Liu
Sure, 'UnixPermissions' might be fine, though that might lead to 'UnixLikePermissions' or a qualifying comment of why they are not _really_ Unix permissions, which are less clear to me.
Michael Easter
A: 

I'd go with class permission_bits { }, probably in a package unix.

Nikolai N Fetissov
That would be PermissionBits according to the usual Java conventions. Just to distinguish the identifier from a method name.
James P.
A: 

1) PermissionStatus
2) st_mode see http://www.gnu.org/s/libc/manual/html_node/Permission-Bits.html#Permission-Bits

crowne