Package org.apache.turbine.om.security

Examples of org.apache.turbine.om.security.Permission


                {
                    throw new DataBackendException(
                        "Internal error - query returned "
                        + results.size() + " rows");
                }
                Permission newPermission = (Permission) results.get(0);
                // add the permission to system-wide cache
                getAllPermissions().add(newPermission);
                // return the object with correct id
                return newPermission;
            }
View Full Code Here


    public boolean add(Collection permissions)
    {
        boolean res = false;
        for (Iterator it = permissions.iterator(); it.hasNext();)
        {
            Permission p = (Permission) it.next();
            res |= add(p);
        }
        return res;
    }
View Full Code Here

    public boolean add(PermissionSet permissionSet)
    {
        boolean res = false;
        for( Iterator it = permissionSet.iterator(); it.hasNext();)
        {
            Permission p = (Permission) it.next();
            res |= add(p);
        }
        return res;
    }
View Full Code Here

        StringBuffer sb = new StringBuffer();
        sb.append("PermissionSet: ");

        for(Iterator it = iterator(); it.hasNext();)
        {
            Permission p = (Permission) it.next();
            sb.append('[');
            sb.append(p.getName());
            sb.append(" -> ");
            sb.append(p.getIdAsObj());
            sb.append(']');
            if (it.hasNext())
            {
                sb.append(", ");
            }
View Full Code Here

     * @return <code>true</code> if the user is assigned the Permission in any
     *         of the given Groups.
     */
    public boolean hasPermission(String permissionName, GroupSet groupset)
    {
        Permission permission;
        try
        {
            permission = TurbineSecurity.getPermissionByName(permissionName);
        }
        catch (TurbineSecurityException e)
View Full Code Here

                {
                    throw new DataBackendException(
                            "Internal error - query returned "
                            + results.size() + " rows");
                }
                Permission newPermission = (Permission) results.get(0);
                // add the permission to system-wide cache
                getAllPermissions().add(newPermission);
                // return the object with correct id
                return newPermission;
            }
View Full Code Here

     */
    public Permission getPermission( String name )
        throws DataBackendException, UnknownEntityException
    {
        PermissionSet permissions = getAllPermissions();
        Permission permission = permissions.getPermission(name);
        if(permission != null)
        {
            return permission;
        }
        else
View Full Code Here

                {
                    throw new DataBackendException(
                        "Internal error - query returned " +
                        results.size() + " rows");
                }
                Permission newPermission = (Permission)results.get(0);
                // add the permission to system-wide cache
                getAllPermissions().add(newPermission);
                // return the object with correct id
                return newPermission;
            }
View Full Code Here

        Vector results = new Vector();

        // Populate the object(s).
        for ( int i=0; i<rows.size(); i++ )
        {
            Permission obj = TurbineSecurity.getNewPermission(null);
            Record row = (Record)rows.elementAt(i);
            ((SecurityObject)obj).setPrimaryKey( row.getValue(1).asInt() );
            ((SecurityObject)obj).setName( row.getValue(2).asString() );
            byte[] objectData = (byte[])row.getValue(3).asBytes();
            Map temp = (Map)ObjectUtils.deserialize(objectData);
View Full Code Here

                                             Vector all)
    {
        Vector clone = (Vector)all.clone();
        for (Enumeration e = some.elements() ; e.hasMoreElements() ;)
        {
            Permission tmp = (Permission) e.nextElement();
            for (Enumeration f = clone.elements() ; f.hasMoreElements() ;)
            {
                Permission tmp2 = (Permission) f.nextElement();
                if (((BaseObject)tmp).getPrimaryKey() ==
                    ((BaseObject)tmp2).getPrimaryKey())
                {
                    clone.removeElement(tmp2);
                    break;
View Full Code Here

TOP

Related Classes of org.apache.turbine.om.security.Permission

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.