// Path: app/controllers/deadbolt/DeadboltHandler.java
// public interface DeadboltHandler
// {
//     /**
//      * Invoked immediately before controller or view restrictions are checked.  This forms the integration with any
//      * authentication actions that may need to occur.
//      */
//     void beforeRoleCheck();
// 
//     /**
//      * Gets the current {@link RoleHolder}, e.g. the current user.
//      *
//      * @return the current role holder
//      */
//     RoleHolder getRoleHolder();
// 
//     /**
//      * Invoked when an access failure is detected on <i>controllerClassName</i>.
//      *
//      * @param controllerClassName the name of the controller access was denied to
//      */
//     void onAccessFailure(String controllerClassName);
// 
//     /**
//      * Gets the accessor used to determine restrictions from an external source.
//      *
//      * @return the accessor for externalised restrictions.  May be null.
//      */
//     ExternalizedRestrictionsAccessor getExternalizedRestrictionsAccessor();
// 
//     /**
//      * Gets the handler used for dealing with resources restricted to specific users/groups.
//      *
//      * @return the handler for restricted resources.  May be null.
//      */
//     RestrictedResourcesHandler getRestrictedResourcesHandler();
// }
// 
// Path: app/controllers/deadbolt/ExternalizedRestrictionsAccessor.java
// public interface ExternalizedRestrictionsAccessor
// {
//     ExternalizedRestrictions getExternalizedRestrictions(String name);
// }
// 
// Path: app/controllers/deadbolt/RestrictedResourcesHandler.java
// public interface RestrictedResourcesHandler
// {
//     /**
//      * Check the access of someone, typically the current user, for the named resource.
//      *
//      * <ul>
//      * <li>If {@link AccessResult#NOT_SPECIFIED} is returned and
//      * {@link controllers.deadbolt.RestrictedResource#staticFallback()} is false, access is denied.</li>
//      * <li>If {@link AccessResult#NOT_SPECIFIED} is returned and
//      * {@link controllers.deadbolt.RestrictedResource#staticFallback()} is true, any further Restrict or
//      * Restrictions annotations are processed.  Note that if no Restrict or Restrictions annotations are present,
//      * access will be allowed.</li>
//      * </ul>
//      *
//      * @param resourceNames the names of the resource
//      * @param resourceParameters additional information on the resource
//      * @return {@link AccessResult#ALLOWED} if access is permitted.  {@link AccessResult#DENIED} if access is denied.
//      * {@link AccessResult#NOT_SPECIFIED} if access is not specified.
//      */
//     AccessResult checkAccess(List<String> resourceNames,
//                              Map<String, String> resourceParameters);
// }
// 
// Path: samples-and-tests/integration-with-secure/app/models/User.java
// @Entity
// public class User extends Model implements RoleHolder
// {
//     @Required
//     public String userName;
// 
//     public String fullName;
// 
//     @Required
//     @ManyToOne
//     public ApplicationRole role;
// 
//     public User(String userName,
//                 String fullName,
//                 ApplicationRole role)
//     {
//         this.userName = userName;
//         this.fullName = fullName;
//         this.role = role;
//     }
// 
//     public static User getByUserName(String userName)
//     {
//         return find("byUserName", userName).first();
//     }
// 
//     @Override
//     public String toString()
//     {
//         return this.userName;
//     }
// 
// 
//     public List<? extends Role> getRoles()
//     {
//         return Arrays.asList(role);
//     }
// }
// 
// Path: app/models/deadbolt/ExternalizedRestrictions.java
// public interface ExternalizedRestrictions
// {
//     /**
//      * Gets all the {@link ExternalizedRestriction}s associated with a target.
//      *
//      * @return
//      */
//     List<ExternalizedRestriction> getExternalisedRestrictions();
// }
// 
// Path: app/models/deadbolt/RoleHolder.java
// public interface RoleHolder
// {
//     /**
//      * A list of {@link Role}s held by the role holder.
//      *
//      * @return a list of roles
//      */
//     List<? extends Role> getRoles();
// }


import controllers.deadbolt.DeadboltHandler;
import controllers.deadbolt.ExternalizedRestrictionsAccessor;
import controllers.deadbolt.RestrictedResourcesHandler;
import models.User;
import models.deadbolt.ExternalizedRestrictions;
import models.deadbolt.RoleHolder;
import play.mvc.Controller;
            }
            catch (Throwable t)
            {
                // handle this in an app-specific way
            }
        }
    }

    public RoleHolder getRoleHolder()
    {
        String userName = Secure.Security.connected();
        return User.getByUserName(userName);
    }

    public void onAccessFailure(String controllerClassName)
    {
       forbidden();
    }

    public ExternalizedRestrictionsAccessor getExternalizedRestrictionsAccessor()
    {
        return new ExternalizedRestrictionsAccessor()
        {
            public ExternalizedRestrictions getExternalizedRestrictions(String name)
            {
                return null;
            }
        };
    }

// Path: app/controllers/deadbolt/DeadboltHandler.java
// public interface DeadboltHandler
// {
//     /**
//      * Invoked immediately before controller or view restrictions are checked.  This forms the integration with any
//      * authentication actions that may need to occur.
//      */
//     void beforeRoleCheck();
// 
//     /**
//      * Gets the current {@link RoleHolder}, e.g. the current user.
//      *
//      * @return the current role holder
//      */
//     RoleHolder getRoleHolder();
// 
//     /**
//      * Invoked when an access failure is detected on <i>controllerClassName</i>.
//      *
//      * @param controllerClassName the name of the controller access was denied to
//      */
//     void onAccessFailure(String controllerClassName);
// 
//     /**
//      * Gets the accessor used to determine restrictions from an external source.
//      *
//      * @return the accessor for externalised restrictions.  May be null.
//      */
//     ExternalizedRestrictionsAccessor getExternalizedRestrictionsAccessor();
// 
//     /**
//      * Gets the handler used for dealing with resources restricted to specific users/groups.
//      *
//      * @return the handler for restricted resources.  May be null.
//      */
//     RestrictedResourcesHandler getRestrictedResourcesHandler();
// }
// 
// Path: app/controllers/deadbolt/ExternalizedRestrictionsAccessor.java
// public interface ExternalizedRestrictionsAccessor
// {
//     ExternalizedRestrictions getExternalizedRestrictions(String name);
// }
// 
// Path: app/controllers/deadbolt/RestrictedResourcesHandler.java
// public interface RestrictedResourcesHandler
// {
//     /**
//      * Check the access of someone, typically the current user, for the named resource.
//      *
//      * <ul>
//      * <li>If {@link AccessResult#NOT_SPECIFIED} is returned and
//      * {@link controllers.deadbolt.RestrictedResource#staticFallback()} is false, access is denied.</li>
//      * <li>If {@link AccessResult#NOT_SPECIFIED} is returned and
//      * {@link controllers.deadbolt.RestrictedResource#staticFallback()} is true, any further Restrict or
//      * Restrictions annotations are processed.  Note that if no Restrict or Restrictions annotations are present,
//      * access will be allowed.</li>
//      * </ul>
//      *
//      * @param resourceNames the names of the resource
//      * @param resourceParameters additional information on the resource
//      * @return {@link AccessResult#ALLOWED} if access is permitted.  {@link AccessResult#DENIED} if access is denied.
//      * {@link AccessResult#NOT_SPECIFIED} if access is not specified.
//      */
//     AccessResult checkAccess(List<String> resourceNames,
//                              Map<String, String> resourceParameters);
// }
// 
// Path: samples-and-tests/integration-with-secure/app/models/User.java
// @Entity
// public class User extends Model implements RoleHolder
// {
//     @Required
//     public String userName;
// 
//     public String fullName;
// 
//     @Required
//     @ManyToOne
//     public ApplicationRole role;
// 
//     public User(String userName,
//                 String fullName,
//                 ApplicationRole role)
//     {
//         this.userName = userName;
//         this.fullName = fullName;
//         this.role = role;
//     }
// 
//     public static User getByUserName(String userName)
//     {
//         return find("byUserName", userName).first();
//     }
// 
//     @Override
//     public String toString()
//     {
//         return this.userName;
//     }
// 
// 
//     public List<? extends Role> getRoles()
//     {
//         return Arrays.asList(role);
//     }
// }
// 
// Path: app/models/deadbolt/ExternalizedRestrictions.java
// public interface ExternalizedRestrictions
// {
//     /**
//      * Gets all the {@link ExternalizedRestriction}s associated with a target.
//      *
//      * @return
//      */
//     List<ExternalizedRestriction> getExternalisedRestrictions();
// }
// 
// Path: app/models/deadbolt/RoleHolder.java
// public interface RoleHolder
// {
//     /**
//      * A list of {@link Role}s held by the role holder.
//      *
//      * @return a list of roles
//      */
//     List<? extends Role> getRoles();
// }


// Path: samples-and-tests/integration-with-secure/app/controllers/MyDeadboltHandler.java
import controllers.deadbolt.DeadboltHandler;
import controllers.deadbolt.ExternalizedRestrictionsAccessor;
import controllers.deadbolt.RestrictedResourcesHandler;
import models.User;
import models.deadbolt.ExternalizedRestrictions;
import models.deadbolt.RoleHolder;
import play.mvc.Controller;

            }
            catch (Throwable t)
            {
                // handle this in an app-specific way
            }
        }
    }

    public RoleHolder getRoleHolder()
    {
        String userName = Secure.Security.connected();
        return User.getByUserName(userName);
    }

    public void onAccessFailure(String controllerClassName)
    {
       forbidden();
    }

    public ExternalizedRestrictionsAccessor getExternalizedRestrictionsAccessor()
    {
        return new ExternalizedRestrictionsAccessor()
        {
            public ExternalizedRestrictions getExternalizedRestrictions(String name)
            {
                return null;
            }
        };
    }

    public RestrictedResourcesHandler getRestrictedResourcesHandler()