Examples of BaseSecurityEntry


Examples of org.apache.jetspeed.om.registry.base.BaseSecurityEntry

    }
   
    public static SecurityEntry mapDatabaseToEntry(SecurityDbEntry sde)
    throws TorqueException
    {
        SecurityEntry se = new BaseSecurityEntry(sde.getId());           
        se.setName(sde.getName());
        se.setTitle(sde.getTitle());
        se.setDescription(sde.getDescription());
       
        Iterator accesses = sde.getSecurityAccessDbEntrys().iterator();
        while (accesses.hasNext())
        {
            SecurityAccessDbEntry sade = (SecurityAccessDbEntry)accesses.next();
            SecurityAccess access = new BaseSecurityAccess(sade.getId());
            access.setAction(sade.getAction());
                           
            Iterator allows = sade.getSecurityAllowDbEntrys().iterator();
            while (allows.hasNext())
            {
                SecurityAllowDbEntry sa = (SecurityAllowDbEntry)allows.next();
                if (sa.getAllowType().equals(ALLOW_OWNER))
                {
                    SecurityAllow allow = new BaseSecurityAllowOwner(sa.getId());                   
                    allow.setOwner(true);
                    access.getOwnerAllows().add(allow);
                }
                else if (sa.getAllowType().equals(ALLOW_BOTH))
                {
                    SecurityAllow allow = new BaseSecurityAllow(sa.getId());
                   
                    allow.setRole(sa.getAllowValue());
                    allow.setGroup(sa.getAllowGroup());
                    access.getAllows().add(allow);               
                }
                else if (sa.getAllowType().equals(ALLOW_ROLE))
                {
                    SecurityAllow allow = new BaseSecurityAllow(sa.getId());
                   
                    allow.setRole(sa.getAllowValue());
                    access.getAllows().add(allow);
                }
                else if (sa.getAllowType().equals(ALLOW_GROUP))
                {
                    SecurityAllow allow = new BaseSecurityAllow(sa.getId());
                   
                    allow.setGroup(sa.getAllowValue());
                    access.getAllows().add(allow);
                }
                else
                {
                    SecurityAllow allow = new BaseSecurityAllow(sa.getId());                   
                    allow.setUser(sa.getAllowValue());
                    access.getAllows().add(allow);
                }                   
            }
            se.getAccesses().add(access);
        }
        return se;
    }
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityEntry

            && (mode.equals(SecurityConstants.PARAM_MODE_DELETE)
                || mode.equals(SecurityConstants.PARAM_MODE_UPDATE)))
        {
            String securityName =
                rundata.getParameters().getString("security_name");
            BaseSecurityEntry securityEntry =
                (BaseSecurityEntry) Registry.getEntry(
                    Registry.SECURITY,
                    securityName);

            String subMode = rundata.getParameters().getString("subMode");
            if (subMode != null)
            {
                context.put("subMode", subMode);
                int accessIndex =
                    rundata.getParameters().getInt("access_index", -1);
                if (accessIndex != -1)
                {
                    context.put("accessIndex", new Integer(accessIndex));
                    accessIndex--;
                    BaseSecurityAccess securityAccess =
                        (BaseSecurityAccess) securityEntry.getAccesses().get(
                            accessIndex);
                    context.put("securityAccess", securityAccess);
                }
            }
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityEntry

    {
        try
        {
            String securityName =
                rundata.getParameters().getString("security_name");
            BaseSecurityEntry securityEntry =
                (BaseSecurityEntry) Registry.getEntry(
                    Registry.SECURITY,
                    securityName);

            if (securityEntry != null)
            {
                String action =
                    rundata.getParameters().getString("access_action");

                if (action != null && action.length() > 0)
                {
                    BaseSecurityAccess securityAccess =
                        new BaseSecurityAccess();
                    securityAccess.setAction(action);

                    addAllow(rundata, securityAccess);

                    Vector accesses = securityEntry.getAccesses();
                    accesses.add(securityAccess);
                    securityEntry.setAccesses(accesses);

                    Registry.addEntry(Registry.SECURITY, securityEntry);
                    clearUserData(rundata);
                }
                else
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityEntry

    {
        try
        {
            String securityName =
                rundata.getParameters().getString("security_name");
            BaseSecurityEntry securityEntry =
                (BaseSecurityEntry) Registry.getEntry(
                    Registry.SECURITY,
                    securityName);
            if (securityEntry != null)
            {
                int accessIndex =
                    rundata.getParameters().getInt("access_index", -1);
                accessIndex--;
                String action =
                    rundata.getParameters().getString("access_action");

                if (accessIndex >= 0
                    && accessIndex < securityEntry.getAccesses().size())
                {
                    BaseSecurityAccess securityAccess =
                        (BaseSecurityAccess) securityEntry.getAccesses().get(
                            accessIndex);
                    securityAccess.setAction(action);

                    Registry.addEntry(Registry.SECURITY, securityEntry);
                    clearUserData(rundata);
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityEntry

    {
        try
        {
            String securityName =
                rundata.getParameters().getString("security_name");
            BaseSecurityEntry securityEntry =
                (BaseSecurityEntry) Registry.getEntry(
                    Registry.SECURITY,
                    securityName);
            if (securityEntry != null)
            {
                int[] accessIndexes =
                    rundata.getParameters().getInts("access_index");

                if (accessIndexes != null && accessIndexes.length > 0)
                {
                    ArrayList deleteList = new ArrayList();

                    for (int i = 0; i < accessIndexes.length; i++)
                    {
                        int accessIndex = accessIndexes[i];
                        accessIndex--;

                        if (accessIndex >= 0
                            && accessIndex < securityEntry.getAccesses().size())
                        {
                            deleteList.add(
                                securityEntry.getAccesses().get(accessIndex));
                        }
                        else
                        {
                            logger.error(
                                "Access Index: " + i + " is out of range");
                        }
                    }


                    Vector accesses = securityEntry.getAccesses();
                    Iterator deleteIter = deleteList.iterator();
                    while (deleteIter.hasNext())
                    {
                        SecurityAccess sa = (SecurityAccess) deleteIter.next();
                        accesses.remove(sa);
                    }
                   
                    securityEntry.setAccesses(accesses);

                    Registry.addEntry(Registry.SECURITY, securityEntry);
                    clearUserData(rundata);
                }
                else
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityEntry

    {
        try
        {
            String securityName =
                rundata.getParameters().getString("security_name");
            BaseSecurityEntry securityEntry =
                (BaseSecurityEntry) Registry.getEntry(
                    Registry.SECURITY,
                    securityName);
            if (securityEntry != null)
            {
                int accessIndex =
                    rundata.getParameters().getInt("access_index", -1);
                accessIndex--;

                if (accessIndex >= 0
                    && accessIndex < securityEntry.getAccesses().size())
                {
                    BaseSecurityAccess securityAccess =
                        (BaseSecurityAccess) securityEntry.getAccesses().get(
                            accessIndex);
                    addAllow(rundata, securityAccess);
                    Registry.addEntry(Registry.SECURITY, securityEntry);
                    clearUserData(rundata);
                }
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityEntry

    {
        try
        {
            String securityName =
                rundata.getParameters().getString("security_name");
            BaseSecurityEntry securityEntry =
                (BaseSecurityEntry) Registry.getEntry(
                    Registry.SECURITY,
                    securityName);
            if (securityEntry != null)
            {
                int accessIndex =
                    rundata.getParameters().getInt("access_index", -1);
                accessIndex--;

                if (accessIndex >= 0
                    && accessIndex < securityEntry.getAccesses().size())
                {
                    BaseSecurityAccess securityAccess =
                        (BaseSecurityAccess) securityEntry.getAccesses().get(
                            accessIndex);

                    String allowType =
                        rundata.getParameters().getString(
                            "allow_type",
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityEntry

        accessElement.setAction(action);
        accessElement.setAllows( allowVector );
        Vector accessVector = new Vector();
        accessVector.addElement(accessElement);
       
        BaseSecurityEntry securityEntry = new BaseSecurityEntry();
        securityEntry.setName(name);
        securityEntry.setAccesses( accessVector);
        return securityEntry;
    }
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityEntry

        accessElement.setAction(action);
        accessElement.setAllows( allowVector );
        Vector accessVector = new Vector();
        accessVector.addElement(accessElement);
       
        BaseSecurityEntry securityEntry = new BaseSecurityEntry();
        securityEntry.setName(name);
        securityEntry.setAccesses( accessVector);
        return securityEntry;
    }
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityEntry

            && (mode.equals(SecurityConstants.PARAM_MODE_DELETE)
                || mode.equals(SecurityConstants.PARAM_MODE_UPDATE)))
        {
            String securityName =
                rundata.getParameters().getString("security_name");
            BaseSecurityEntry securityEntry =
                (BaseSecurityEntry) Registry.getEntry(
                    Registry.SECURITY,
                    securityName);

            String subMode = rundata.getParameters().getString("subMode");
            if (subMode != null)
            {
                context.put("subMode", subMode);
                int accessIndex =
                    rundata.getParameters().getInt("access_index", -1);
                if (accessIndex != -1)
                {
                    context.put("accessIndex", new Integer(accessIndex));
                    accessIndex--;
                    BaseSecurityAccess securityAccess =
                        (BaseSecurityAccess) securityEntry.getAccesses().get(
                            accessIndex);
                    context.put("securityAccess", securityAccess);
                }
            }
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.