Package com.adito.security

Examples of com.adito.security.SessionInfo


   
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errs = new ActionErrors();
        // on removal we need to ensure that we are not ostresizing the super user.
        if (this.getActionTarget() != null && this.getActionTarget().equals("confirmRemove")) {
            SessionInfo info = LogonControllerFactory.getInstance().getSessionInfo(request);
            boolean found = false;

            try {
                List authSchemes = ResourceUtil.getGrantedResource(info, PolicyConstants.AUTHENTICATION_SCHEMES_RESOURCE_TYPE);
                for (Iterator iter = authSchemes.iterator(); iter.hasNext();) {
                    AuthenticationScheme element = (DefaultAuthenticationScheme) iter.next();
                    if (!element.isSystemScheme() && element.getEnabled()) {
                        List attachedPolicies = PolicyDatabaseFactory.getInstance().getPoliciesAttachedToResource(
                                        element, info.getUser().getRealm());
                        for (Iterator iterator = attachedPolicies.iterator(); iterator.hasNext();) {
                            Policy policy = (Policy) iterator.next();
                            // we don't check the current policy as it is about to be deleted.
                            if (policy.getResourceId() != this.selectedResource && PolicyDatabaseFactory.getInstance().isPolicyGrantedToUser(policy,
                                            info.getUser())) {
                                found = true;
                                break;
                            }
                        }
                    }
View Full Code Here


     */
    public void init(AbstractWizardSequence sequence, HttpServletRequest request) throws Exception {
        super.init(sequence, request);
        this.selectedModules = ((PropertyList) sequence.getAttribute(ATTR_SELECTED_MODULES, new PropertyList()));
        MultiSelectDataSource modules = new ModulesDataSource("security");
        SessionInfo session = LogonControllerFactory.getInstance().getSessionInfo(request);
        this.moduleModel = new MultiSelectSelectionModel(session, modules, selectedModules);
    }
View Full Code Here

    return null;   
  }

  private ActionForward checkAccess(ActionMapping mapping, FileSystemForm fileSystemForm, HttpServletRequest request)
          throws NoPermissionException {
    SessionInfo actualSession = LogonControllerFactory.getInstance().getSessionInfo(request);
    SessionInfo session = fileSystemForm.getLaunchSession().getSession();

    if (fileSystemForm.getNetworkPlace() != null) {
      NetworkPlace resource = fileSystemForm.getNetworkPlace();

      // check access for the attributes on the NetworkPlace.
      if (resource.isNoDelete() && NO_DELETE.contains(fileSystemForm.getActionTarget())) {
        ActionMessages msgs = getErrors(request);
        msgs.add(Globals.ERROR_KEY, new BundleActionMessage(NetworkPlacePlugin.MESSAGE_RESOURCES_KEY, "vfs.noDelete.error"));
        saveMessages(request, msgs);
        return mapping.getInputForward();
      }
    }

    try {
      if(fileSystemForm.getLaunchSession().isTracked()) {
        LaunchSession.AccessRight accessRight = fileSystemForm.getLaunchSession().checkAccessRights(null, actualSession);
        if (accessRight == LaunchSession.USER_ACCESS || isSuperUser(request)) {
          fileSystemForm.setReadWrite();
        } else if (accessRight == LaunchSession.MANAGEMENT_ACCESS) {
          ActionMessages warnings = getWarnings(request);
          warnings.add(Constants.REQ_ATTR_WARNINGS, new BundleActionMessage(NetworkPlacePlugin.MESSAGE_RESOURCES_KEY, "vfs.manageOnly.warning"));
          saveWarnings(request, warnings);
        }
      }
      return null;
    } catch (Exception e) {
      log.error("Failed to test if user has access to resource. Denying", e);
      throw new NoPermissionException("Permission denied.", session.getUser(), NetworkPlacePlugin.NETWORK_PLACE_RESOURCE_TYPE);
    }
  }
View Full Code Here

      throw new NoPermissionException("Permission denied.", session.getUser(), NetworkPlacePlugin.NETWORK_PLACE_RESOURCE_TYPE);
    }
  }

    private boolean isSuperUser(HttpServletRequest request) {
        SessionInfo sessionInfo = getSessionInfo(request);
        return LogonControllerFactory.getInstance().isAdministrator(sessionInfo.getUser());
    }
View Full Code Here

                AbstractWizardSequence seq = (AbstractWizardSequence) request.getSession().getAttribute(Constants.WIZARD_SEQUENCE);

                AbstractKeyStoreImportType importType = KeyStoreImportTypeManager.getInstance().getType(
                    (String)seq.getAttribute(KeyStoreImportTypeForm.ATTR_TYPE, ReplyFromCAImportType.REPLY_FROM_CA));
                SessionInfo sessionInfo = getSessionInfo(request);
                importType.validate(errs, alias, passphrase, seq, sessionInfo);

                if (errs.size() == 0) {

                    in = uploadFile.getInputStream();
View Full Code Here

    public int doStartTag() {
        if (pageContext.getSession().getAttribute(Constants.WIZARD_SEQUENCE) != null) {
            return SKIP_BODY;
        } else {
            SessionInfo info = LogonControllerFactory.getInstance().getSessionInfo(
                (HttpServletRequest) pageContext.getRequest());
            if (info == null || info.getNavigationContext() != SessionInfo.MANAGEMENT_CONSOLE_CONTEXT) {
                return SKIP_BODY;
            } else {
                return EVAL_BODY_INCLUDE;
            }
        }
View Full Code Here

              return SKIP_BODY;
          else
              return EVAL_BODY_INCLUDE;
      }
      else {
          SessionInfo info = LogonControllerFactory.getInstance().getSessionInfo((HttpServletRequest)pageContext.getRequest());
          if(info == null || info.getNavigationContext() != SessionInfo.USER_CONSOLE_CONTEXT) {
             return requires ? SKIP_BODY : EVAL_BODY_INCLUDE;
          }
          else {
             return requires ? EVAL_BODY_INCLUDE : SKIP_BODY;
          }             
View Full Code Here

        policyModel = initSelectModel(mapping, request, selectedPolicies, isShowPersonalPolicies());
       
        setSelectedPolicies(selectedPolicies);
       
        MultiSelectDataSource policies = createDatasource(mapping, request);
        SessionInfo session = LogonControllerFactory.getInstance().getSessionInfo(request);
        //policyModel = new MultiSelectSelectionModel(session, policies, selectedPolicies);
    }
View Full Code Here

        MultiSelectDataSource personalPolicies = null;
        if (!isShowPersonalPolicies) {
            personalPolicies = policies;
            policies = createDatasourceExcludePersonal(mapping, request);
        }
        SessionInfo session = LogonControllerFactory.getInstance().getSessionInfo(request);
        MultiSelectPoliciesSelectionModel policyModel = new MultiSelectPoliciesSelectionModel(session, policies, personalPolicies, selectedPolicies);
        return policyModel;
    }
View Full Code Here

        super.initialize(session, "user");
        Map active = LogonControllerFactory.getInstance().getActiveSessions();
        for (Iterator i = active.entrySet().iterator(); i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();
            String ticket = (String) entry.getKey();
            SessionInfo info = (SessionInfo) entry.getValue();
            ActiveSession activeSession = new ActiveSession(info);
            getModel().addItem(activeSession);
        }
        getPager().rebuild(getFilterText());
    }
View Full Code Here

TOP

Related Classes of com.adito.security.SessionInfo

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.