Examples of SecurityContext


Examples of javax.ws.rs.core.SecurityContext

    // From now on we can use this class since it's there. I (Stef Epardaud) don't think we need to
    // remove the reference here and use reflection.
    RolesAllowed rolesAllowed = m.getAnnotation(RolesAllowed.class);
    if(rolesAllowed == null)
      return true;
    SecurityContext context = ResteasyProviderFactory.getContextData(SecurityContext.class);
    for(String role : rolesAllowed.value())
      if(context.isUserInRole(role))
        return true;
    return false;
  }
View Full Code Here

Examples of javax.ws.rs.core.SecurityContext

   public ServerResponse preProcess(HttpRequest request, ResourceMethod method) throws Failure, WebApplicationException
   {
      if (denyAll) throw new UnauthorizedException();
      if (rolesAllowed != null)
      {
         SecurityContext context = ResteasyProviderFactory.getContextData(SecurityContext.class);
         if (context != null)
         {
            for (String role : rolesAllowed)
            {
               if (context.isUserInRole(role)) return null;
            }
            throw new UnauthorizedException();
         }
      }
      return null;
View Full Code Here

Examples of javolution.context.SecurityContext

     */
    public static  <T>  void configure(Configurable <T>  cfg,
             T  newValue) throws SecurityException {
        if (newValue == null)
            throw new IllegalArgumentException("Default value cannot be null");
        SecurityContext policy = (SecurityContext) SecurityContext.getCurrentSecurityContext();


        if (!policy.isConfigurable(cfg))
            throw new SecurityException(
                    "Configuration disallowed by SecurityContext");
         T  oldValue = cfg._value;


View Full Code Here

Examples of juzu.request.SecurityContext

    //
    boolean ok = false;
    if (denyAll != null) {
      ok = false;
    } else if (rolesAllowed != null) {
      SecurityContext securityContext = request.getSecurityContext();
      for (String role : rolesAllowed.value()) {
        if (securityContext.isUserInRole(role)) {
          ok = true;
          break;
        }
      }
    } else {
View Full Code Here

Examples of net.jini.security.SecurityContext

      if (strongRef instanceof Unreferenced) {
    final Unreferenced obj = (Unreferenced) strongRef;
    final Thread t = (Thread) AccessController.doPrivileged(
        new NewThreadAction(new Runnable() {
      public void run() {
          SecurityContext securityContext =
        target.getSecurityContext();
          AccessController.doPrivileged(securityContext.wrap(
        new PrivilegedAction() {
            public Object run() {
          obj.unreferenced();
          return null;
            }
        }), securityContext.getAccessControlContext());
      }
        }, "Unreferenced", false, true));
    AccessController.doPrivileged(new PrivilegedAction() {
        public Object run() {
      t.setContextClassLoader(
View Full Code Here

Examples of oracle.adf.share.security.SecurityContext

    private static final String ldapPwdLastSetAttribute = "PWDLASTSET";

    public OpssBean() {

        ADFContext adfCtx = ADFContext.getCurrent();
        SecurityContext secCntx = adfCtx.getSecurityContext();

        this.username = secCntx.getUserName();

        for (String role : secCntx.getUserRoles()) {
            this.roles = this.roles + role + ", ";
        }

        try {
            jpsCtx = JpsContextFactory.getContextFactory().getContext();
            IdentityStoreService service =
                  jpsCtx.getServiceInstance(IdentityStoreService.class);
           
            idStore = service.getIdmStore();

            User user = idStore.searchUser(secCntx.getUserName());
            if (user != null) {
                userProfile = user.getUserProfile();
                PropertySet propSet = userProfile.getAllUserProperties();

                Iterator it = propSet.getAll();
View Full Code Here

Examples of org.acegisecurity.context.SecurityContext

public class AcegiWorkflowContextHandlerInterceptorDifferentProviderTests extends AbstractWorkflowContextHandlerInterceptorTests {


  protected MockHttpServletRequest getMockRequest(String userName) {
    Authentication auth = new AnonymousAuthenticationToken(userName, userName, new GrantedAuthority[]{ new GrantedAuthorityImpl(userName) });
    SecurityContext context = new SecurityContextImpl();
    context.setAuthentication(auth);
    SecurityContextHolder.setContext(context);

    return new MockHttpServletRequest();
  }
View Full Code Here

Examples of org.apache.activemq.security.SecurityContext

    @Test(expected = IllegalArgumentException.class)
    public void testNonSubjectSecurityContext() {
        SubjectConnectionReference reference =
                new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                        new DefaultEnvironment(), new SubjectAdapter());
        reference.getConnectionContext().setSecurityContext(new SecurityContext("") {
            @Override
            public Set<Principal> getPrincipals() {
                return null;
            }
        });
View Full Code Here

Examples of org.apache.airavata.gfac.SecurityContext

    public void setContextHeader(ContextHeaderDocument.ContextHeader contextHeader) {
        this.contextHeader = contextHeader;
    }

  public SecurityContext getSecurityContext(String name) throws GFacException{
    SecurityContext secContext = securityContext.get(name);
    if(secContext == null){
      throw new GFacException( name + " not set in security context");
    }
    return secContext;
  }
View Full Code Here

Examples of org.apache.airavata.gfac.context.security.SecurityContext

    public void setContextHeader(ContextHeaderDocument.ContextHeader contextHeader) {
        this.contextHeader = contextHeader;
    }

  public SecurityContext getSecurityContext(String name) throws GFacException{
    SecurityContext secContext = securityContext.get(name);
    if(secContext == null){
      throw new GFacException( name + " not set in security context");
    }
    return secContext;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.