// Path: app/models/deadbolt/AccessResult.java
// public enum AccessResult
// {
//     ALLOWED,
//     DENIED,
//     NOT_SPECIFIED
// }
// 
// Path: app/models/deadbolt/ExternalizedRestriction.java
// public interface ExternalizedRestriction
// {
//     /**
//      * Gets the role names required to get by this restriction.
//      *
//      * @return the role names
//      */
//     List<String> getRoleNames();
// }
// 
// 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/Role.java
// public interface Role
// {
//     /**
//      * The name of the role.
//      *
//      * @return the role name
//      */
//     String getRoleName();
// }
// 
// 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 java.util.List;
import java.util.Map;
import models.deadbolt.AccessResult;
import models.deadbolt.ExternalizedRestriction;
import models.deadbolt.ExternalizedRestrictions;
import models.deadbolt.Role;
import models.deadbolt.RoleHolder;
import play.Logger;
import play.Play;
import play.exceptions.ConfigurationException;
import play.mvc.Before;
import play.mvc.Controller;
import play.mvc.Util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
                RestrictedResourcesHandler restrictedResourcesHandler = DEADBOLT_HANDLER.getRestrictedResourcesHandler();

                if (restrictedResourcesHandler == null)
                {
                    Logger.fatal("A RestrictedResource is specified but no RestrictedResourcesHandler is available.  Denying access to resource.");
                }
                else
                {
                    String[] names = restrictedResource.name();
                    AccessResult accessResult = restrictedResourcesHandler.checkAccess(names == null ? Collections.<String>emptyList() : Arrays.asList(names),
                                                                                       Collections.<String, String>emptyMap());
                    switch (accessResult)
                    {
                        case DENIED:
                            accessFailed();
                            break;
                        case NOT_SPECIFIED:
                            if (restrictedResource.staticFallback())
                            {
                                Logger.info("Access for [%s] not defined for current user - processing further with other Deadbolt annotations",
                                            (Object[])names);
                                handleStaticChecks(roleHolder);
                            }
                            else
                            {
                                accessFailed();
                            }
                            break;
                        default:
                            Logger.debug("RestrictedResource - access allowed for [%s]",
// Path: app/models/deadbolt/AccessResult.java
// public enum AccessResult
// {
//     ALLOWED,
//     DENIED,
//     NOT_SPECIFIED
// }
// 
// Path: app/models/deadbolt/ExternalizedRestriction.java
// public interface ExternalizedRestriction
// {
//     /**
//      * Gets the role names required to get by this restriction.
//      *
//      * @return the role names
//      */
//     List<String> getRoleNames();
// }
// 
// 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/Role.java
// public interface Role
// {
//     /**
//      * The name of the role.
//      *
//      * @return the role name
//      */
//     String getRoleName();
// }
// 
// 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: app/controllers/deadbolt/Deadbolt.java
import java.util.List;
import java.util.Map;
import models.deadbolt.AccessResult;
import models.deadbolt.ExternalizedRestriction;
import models.deadbolt.ExternalizedRestrictions;
import models.deadbolt.Role;
import models.deadbolt.RoleHolder;
import play.Logger;
import play.Play;
import play.exceptions.ConfigurationException;
import play.mvc.Before;
import play.mvc.Controller;
import play.mvc.Util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

                RestrictedResourcesHandler restrictedResourcesHandler = DEADBOLT_HANDLER.getRestrictedResourcesHandler();

                if (restrictedResourcesHandler == null)
                {
                    Logger.fatal("A RestrictedResource is specified but no RestrictedResourcesHandler is available.  Denying access to resource.");
                }
                else
                {
                    String[] names = restrictedResource.name();
                    AccessResult accessResult = restrictedResourcesHandler.checkAccess(names == null ? Collections.<String>emptyList() : Arrays.asList(names),
                                                                                       Collections.<String, String>emptyMap());
                    switch (accessResult)
                    {
                        case DENIED:
                            accessFailed();
                            break;
                        case NOT_SPECIFIED:
                            if (restrictedResource.staticFallback())
                            {
                                Logger.info("Access for [%s] not defined for current user - processing further with other Deadbolt annotations",
                                            (Object[])names);
                                handleStaticChecks(roleHolder);
                            }
                            else
                            {
                                accessFailed();
                            }
                            break;
                        default:
                            Logger.debug("RestrictedResource - access allowed for [%s]",
                                         (Object[])names);