Package java.security

Examples of java.security.AccessControlContext


                    return true;
                }
                return false;
            }
        };
        return new AccessControlContext(new ProtectionDomain[] { domain });
    }
View Full Code Here


    }


    protected AccessControlContext getAccessControlContext( final Object ref )
    {
        return new AccessControlContext( new ProtectionDomain[]
            { ref.getClass().getProtectionDomain() } );
    }
View Full Code Here

         }
      }

      try
      {
         AccessControlContext subjectContext = getSubjectContext(subject, context);
         return Subject.doAsPrivileged(subject, action, subjectContext);
      }
      catch (PrivilegedActionException x)
      {
         throw x.getException();
View Full Code Here

         return (AccessControlContext)AccessController.doPrivileged(new PrivilegedAction()
         {
            public Object run()
            {
               InjectingDomainCombiner combiner = new InjectingDomainCombiner(subject);
               AccessControlContext acc = new AccessControlContext(context, combiner);
               AccessController.doPrivileged(new PrivilegedAction()
               {
                  public Object run()
                  {
                     // Check this permission, that is required anyway, to combine the domains
                     sm.checkPermission(new AuthPermission("doAsPrivileged"));
                     return null;
                  }
               }, acc);
               ProtectionDomain[] combined = combiner.getCombinedDomains();
               return new AccessControlContext(combined);
            }
         });
      }
   }
View Full Code Here

        super.doEdit(request, response);
    }

    private Subject getSubject()
    {
        AccessControlContext context = AccessController.getContext();
        return JSSubject.getSubject(context);        
    }
View Full Code Here

public class SecurityHelper {
   
    private static Logger logger = Logger.getLogger(SecurityHelper.class.getName());
   
    private static X500PrivateCredential getPrivateCredentials() {
        AccessControlContext ctx = AccessController.getContext();
       
        if (ctx == null) {
            return null;
        }
        Subject subject = Subject.getSubject(ctx);
View Full Code Here

   * Return the current user, including any doAs in the current stack.
   * @return the current user
   * @throws IOException if login fails
   */
  public static UserGroupInformation getCurrentUser() throws IOException {
    AccessControlContext context = AccessController.getContext();
    Subject subject = Subject.getSubject(context);
    return subject == null ? getLoginUser() : new UserGroupInformation(subject);
  }
View Full Code Here

    static final Logger logger = LoggerFactory.getLogger(SSOPortletUtil.class);
   
    public static Subject getSubject()
    {
        AccessControlContext context = AccessController.getContext();
        return JSSubject.getSubject(context);        
    }
View Full Code Here

    /*
     * Helper methods
     */
    private Subject getSubject()
    {
        AccessControlContext context = AccessController.getContext();
        return JSSubject.getSubject(context);        
    }
View Full Code Here

   */
  @InterfaceAudience.Public
  @InterfaceStability.Evolving
  public synchronized
  static UserGroupInformation getCurrentUser() throws IOException {
    AccessControlContext context = AccessController.getContext();
    Subject subject = Subject.getSubject(context);
    if (subject == null || subject.getPrincipals(User.class).isEmpty()) {
      return getLoginUser();
    } else {
      return new UserGroupInformation(subject);
View Full Code Here

TOP

Related Classes of java.security.AccessControlContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.