Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source.
   * Copyright 2012 Red Hat, Inc., and individual contributors
   * as indicated by the @author tags.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package io.undertow.servlet.api;
 
 import java.util.Set;

Author(s):
Stuart Douglas
 
 public class SecurityInfo<T extends SecurityInfoimplements Cloneable {

    
Equivalent to ServletSecurity.EmptyRoleSemantic but with an additional mode to require authentication but no role check.
 
     public enum EmptyRoleSemantic {

        
Permit access to the resource without requiring authentication or role membership.
 
         PERMIT,

        
Deny access to the resource regardless of the authentication state.
 
         DENY,

        
Mandate authentication but authorize access as no roles to check against.
 
         AUTHENTICATE;
 
     }
 
     private volatile EmptyRoleSemantic emptyRoleSemantic = .;
     private final Set<StringrolesAllowed = new HashSet<String>();
 
         return ;
     }
 
     public T setEmptyRoleSemantic(final EmptyRoleSemantic emptyRoleSemantic) {
         this. = emptyRoleSemantic;
         return (T)this;
     }
 
         return ;
     }
 
     public T setTransportGuaranteeType(final TransportGuaranteeType transportGuaranteeType) {
         this. = transportGuaranteeType;
         return (T) this;
     }
 
     public T addRoleAllowed(final String role) {
         this..add(role);
         return (T) this;
     }
 
     public T addRolesAllowed(final String ... roles) {
         this..addAll(Arrays.asList(roles));
         return (T) this;
     }
     public T addRolesAllowed(final Collection<Stringroles) {
         this..addAll(roles);
         return (T) this;
     }
     public Set<StringgetRolesAllowed() {
         return new HashSet<String>();
     }
 
     @Override
     public T clone() {
         final SecurityInfo info = createInstance();
         info.emptyRoleSemantic = ;
         info.transportGuaranteeType = ;
         info.rolesAllowed.addAll();
         return (T) info;
     }
    protected T createInstance() {
        return (T) new SecurityInfo();
    }
New to GrepCode? Check out our FAQ X