View Single Post
Old 10-10-2012, 10:12 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I use a factory to create my users. Since I took the approach to mirror windows ACL as closely as possible, I have a principal, users and groups. A principal is neither a user nor a group, it is simply an identity object, but both users and groups are principal. This lets me assign ACL privileges to either users or groups since they are specified as principals and not users or groups.
Given an id, I can't tell what the principal is until its been factoried. It wraps its type for construction based on what the claimed instanceof object is stored in the database. When it comes to security with the ACL though, it doesn't make a difference what the principal is.
Fou-Lu is offline   Reply With Quote