WPI GDC CMS 0.0.1

org.wpi.gdc.cms.main
Class ACLEntry

java.lang.Object
  |
  +--org.wpi.gdc.cms.main.ACLEntry
Direct Known Subclasses:
ACLGroupEntry, ACLUserEntry

public abstract class ACLEntry
extends java.lang.Object

An Access Control List entry. This class is abstract as there are two types of ACL Entries: group entries and user entries.

Version:
1.2
Author:
dmpotter

Field Summary
protected  int permissions
          The permissions this entry grants.
 
Constructor Summary
ACLEntry()
           
 
Method Summary
abstract  boolean checkUser(User user)
          Determines if the User object passed has permissions that come from this ACL.
 int getPermissions()
          Gets the permissions associated with this ACL entry.
 boolean hasPermission(int flags)
          Checks to see if all permissions passed (from the ACL class's permission constants) are present on this ACLEntry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

permissions

protected int permissions
The permissions this entry grants. The permissions are a bit field, the bits are defined in ACL.
Constructor Detail

ACLEntry

public ACLEntry()
Method Detail

getPermissions

public int getPermissions()
Gets the permissions associated with this ACL entry.
Returns:
a flag with all the bits defined in the ACL class set for every permission this ACL has.

checkUser

public abstract boolean checkUser(User user)
Determines if the User object passed has permissions that come from this ACL. (In other words, if this is a User ACL entry, this is true if the User passed is the user being checked, if it is a Group ACL entry, it is true if the User being passed is in the group.)
Parameters:
user - the user being checked as gaining permissions from this entry.
Returns:
true if the user does gain permissions from this entry, false otherwise.

hasPermission

public boolean hasPermission(int flags)
Checks to see if all permissions passed (from the ACL class's permission constants) are present on this ACLEntry.
Parameters:
flags - the permissions to check if are present.
Returns:
true if the permissions are allowed, false if they are not.

WPI GDC CMS 0.0.1

Copyright © 2001 WPI Game Development Club. All Rights Reserved.