Examples of JPrincipal


Examples of com.main.gui.JPrincipal

    public static JPrincipal getPrincipal() {
        if (principal == null) {
            carregandoDebug("Principal");
            try {
                principal = new JPrincipal(Carregador.getMe());
            } catch (Exception ex) {
                ex.printStackTrace(System.err);
                principal = new JPrincipal(Carregador.getMe());
            }
            Rectangle rectangle = Configuracoes.LOCAL_PRINCIPAL.getValor();
            if (rectangle != null) {
                principal.setBounds(rectangle);
            }
View Full Code Here

Examples of org.ow2.easybeans.security.struct.JPrincipal

        Principal principal = principals.keySet().iterator().next();
        this.runAsSubject.getPrincipals().add(principal);

        // Add roles for this principal
        Group roles = new JGroup("roles");
        roles.addMember(new JPrincipal(runAsRole));

        // Add list roles for this role
        for (Principal member : principals.get(principal)) {
            roles.addMember(member);
        }
View Full Code Here

Examples of org.ow2.easybeans.security.struct.JPrincipal

        Map<Principal, List<Principal>> principalMap = new HashMap<Principal, List<Principal>>();
        // List of principals to return
        List<Principal> principals = new ArrayList<Principal>();

        // By default, build the principal with the run-as role value
        Principal principal = new JPrincipal(this.runAsRole);

        // Get the EasyBeans DD
        EasyBeansDD easyBeansDD = this.bean.getEjbJarDeployableMetadata().getEasyBeansDD();
        if (easyBeansDD != null) {
            // Get the current bean name
            String beanName = this.bean.getJCommonBean().getName();

            // For each declared session bean
            List<Session> sessions = easyBeansDD.getEJB().getSessions();
            for (Session session : sessions) {
                String ejbName = session.getEjbName();

                // Found the bean to analyze
                if (beanName.equals(ejbName)) {
                    RunAs runAs = session.getRunAs();
                    if (runAs != null) {
                        // Found the principal name to use with the current bean
                        String beanPincipalName = runAs.getPrincipalName();
                        principal = new JPrincipal(beanPincipalName);

                        // Read security role mappings to get all roles for the principal name identity
                        for (SecurityRoleMapping securityRoleMapping : easyBeansDD.getSecurityRoleMappings()) {
                            for (String pincipalName : securityRoleMapping.getPrincipalNames()) {
                                if (beanPincipalName.equals(pincipalName)) {
                                    principals.add(new JPrincipal(securityRoleMapping.getRoleName()));
                                }
                            }
                        }
                    }
                }
View Full Code Here

Examples of org.ow2.easybeans.security.struct.JPrincipal

        }

        Principal[] principals = new Principal[roles.length];
        int i = 0;
        for (String role : roles) {
            principals[i++] = new JPrincipal(role);
        }
        return principals;
    }
View Full Code Here

Examples of org.ow2.easybeans.security.struct.JPrincipal

     */
    public static Subject buildSubject(final String userName, final List<String> roleList) {
        Subject subject = new Subject();

        // Add principal name
        Principal principalName = new JPrincipal(userName);
        subject.getPrincipals().add(principalName);

        // Add roles for this principal
        Group roles = new JGroup("roles");
        if (roleList != null) {
            for (String role : roleList) {
                roles.addMember(new JPrincipal(role));
            }
        }
        subject.getPrincipals().add(roles);

        return subject;
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.