Lots of times we don't care WHY someone lacks access, just that they do; so
add convenience wrappers giving us a boolean back instead of forcing us to see if checkAccess(blah) == null. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5132 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -80,10 +80,27 @@ public class ClientObject extends DObject
|
||||
{
|
||||
return checkAccess(perm, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience wrapper around {@link #checkAccess} that simply returns a boolean indicating
|
||||
* whether or not this client has the permission rather than an explanation.
|
||||
*/
|
||||
public boolean hasAccess (Permission perm, Object context)
|
||||
{
|
||||
return checkAccess(perm, context) == null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience wrapper around {@link #checkAccess} that simply returns a boolean indicating
|
||||
* whether or not this client has the permission rather than an explanation.
|
||||
*/
|
||||
public boolean hasAccess (Permission perm)
|
||||
{
|
||||
return checkAccess(perm) == null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for reference counting client objects, adds a reference to
|
||||
* this object.
|
||||
* Used for reference counting client objects, adds a reference to this object.
|
||||
*/
|
||||
public synchronized void reference ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user