Package org.apache.jetspeed.om.security

Examples of org.apache.jetspeed.om.security.Role


                            qs.clearName = true;
                        }
                    }
                    else if (QUERY_BY_ROLE == qs.queryBy)
                    {
                        Role role = qs.profile.getRole();
                        if (null == role)
                        {
                            role = JetspeedRoleFactory.getInstance();
                            role.setName(file.getName());
                            qs.profile.setRole(role);
                            qs.clearName = true;
                        }
                    }
                    else if (QUERY_BY_GROUP == qs.queryBy)
View Full Code Here


    protected void dumpProfile(Profile profile)
    {
        JetspeedUser user = profile.getUser();
        Group group = profile.getGroup();
        Role role = profile.getRole();
        if (profile.getAnonymous() == true)
            System.out.println("ANON USER");
        System.out.println("RESOURCE = " + profile.getName());
        if (null != user)
            System.out.println("USER = " + user.getUserName() );
        if (null != group)
            System.out.println("GROUP = " + group.getName() );
        if (null != role)
            System.out.println("ROLE = " + role.getName() );
        System.out.println("MEDIA TYPE = " + profile.getMediaType());
        System.out.println("LANGUAGE = " + profile.getLanguage());
        System.out.println("COUNTRY = " + profile.getCountry());
        PSMLDocument doc = profile.getDocument();
        if (null == doc)
View Full Code Here

            {
                uri.addPathInfo(Profiler.PARAM_GROUP, group.getName());
            }
            else
            {
                Role role = locator.getRole();
                if (null != role)
                {
                    uri.addPathInfo(Profiler.PARAM_ROLE, role.getName());
                }
            }
        }

        // check Page to add to the uri
View Full Code Here

    protected String locatorToString(ProfileLocator locator)
    {
        StringBuffer keybuf = new StringBuffer();

        JetspeedUser user = locator.getUser();
        Role role = locator.getRole();
        Group group = locator.getGroup();
        String name = locator.getName();
        String mediaType = locator.getMediaType();
        String country = locator.getCountry();
        String language = locator.getLanguage();

       synchronized (this)
       {
            if (user != null)
            {
                keybuf.append("User:").append(user.getUserName());
           }
            else if (group != null)
            {
                keybuf.append("Group:").append(group.getName());
            }
            else if (role != null)
            {
                keybuf.append("Role:").append(role.getName());
            }

            if (name != null)
            {
                keybuf.append('$').append("Page:").append(name);
View Full Code Here

            logger.warn("DatabasePsmlManagerService.createOrSaveDocument: " + message);
            throw new IllegalArgumentException(message);
        }

        JetspeedUser user = profile.getUser();
        Role role = profile.getRole();
        Group group = profile.getGroup();
        String tableName = null;

        Connection dbCon = getDbConnection();
View Full Code Here

            logger.warn("DatabasePsmlManagerService.removeDocument: " + message);
            throw new IllegalArgumentException(message);
        }

        JetspeedUser user = locator.getUser();
        Role role = locator.getRole();
        Group group = locator.getGroup();
        String tableName = null;

        // get a database connection
        Connection dbCon = getDbConnection();
View Full Code Here

            logger.warn("DatabasePsmlManagerService.refresh: " + message);
            throw new IllegalArgumentException(message);
        }

        JetspeedUser user = locator.getUser();
        Role role = locator.getRole();
        Group group = locator.getGroup();
        String tableName = null;
        List records = null;
        Portlets portlets = null;
        PSMLDocument psmldoc = null;
View Full Code Here

    public Profile createRoleProfile(JetspeedRoleProfile entity, Portlets portlets)
    {
        Profile profile = Profiler.createProfile();
        try
        {
            Role role = JetspeedSecurity.getRole(entity.getRoleName());
            if (null == role)
            {
                role = JetspeedRoleFactory.getInstance();
                role.setName(entity.getRoleName());
            }
            profile.setRole(role);
            profile.setMediaType(entity.getMediaType());
            profile.setLanguage(entity.getLanguage());
            profile.setCountry(entity.getCountry());
View Full Code Here

        try
        {
            Iterator roles = JetspeedSecurity.getRoles(user.getUserName());
            while (roles.hasNext())
            {
                Role role = (Role)roles.next();
                return JetspeedSecurity.hasPermission(role.getName(), action);
            }
       
        } catch (Exception e)
        {
            logger.error("Exception",  e);
View Full Code Here

        try
        {
            Iterator roles = JetspeedSecurity.getRoles();
            while (roles.hasNext())
            {
                Role role = (Role)roles.next();
                Map map = new HashMap();
                Iterator prms = JetspeedSecurity.getPermissions(role.getName());
                while (prms.hasNext())
                {
                    Permission perm = (Permission)prms.next();
                    map.put(perm.getName(), perm);
                }
                perms.put(role.getName(), map);
            }
        }
        catch (JetspeedSecurityException e)
        {
            logger.error("Exception", e);
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.security.Role

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.