examples.access
Class AccessRightsChecker

java.lang.Object
  extended by examples.access.AccessRightsChecker

public class AccessRightsChecker
extends Object

As the name indicates, checks whether a user possesses a given permission. AccessRightsChecker is also a stand-alone java application, simulating a very simple and short simulation of invocation of a AccessRightsChecker

Author:
Ceki Gulcu

Constructor Summary
AccessRightsChecker(PermissionMap permissionMap)
           
 
Method Summary
 boolean hasPermission(User user, Permission permission)
          Does the user have the permission passed as parameter?
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessRightsChecker

public AccessRightsChecker(PermissionMap permissionMap)
Method Detail

hasPermission

public boolean hasPermission(User user,
                             Permission permission)
                      throws AccessException
Does the user have the permission passed as parameter?

Parameters:
user - the user to check against
permission - the permission to check
Returns:
true if the user has the permission, false otherwise.
Throws:
AccessException - thrown if there is a problem checking user permissions

main

public static void main(String[] args)
                 throws ch.qos.logback.audit.AuditException,
                        AccessException
Throws:
ch.qos.logback.audit.AuditException
AccessException


Copyright © 2013. All Rights Reserved.