Package org.apache.turbine.om.security

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


     * @exception Exception,
     *                a generic exception.
     */
    public boolean hasPermission(String permission) throws Exception
    {
        Permission permissionObject = null;
        try
        {
            permissionObject = TurbineSecurity.getPermissionByName(permission);
        }
        catch (UnknownEntityException e)
View Full Code Here


            List results = new ArrayList();

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

    public static final Vector getDifference(Vector some, 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

     */
    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

     */
    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

     * @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.getPermission(permissionName);
        }
        catch(TurbineSecurityException e)
View Full Code Here

    public boolean contains(String permissionName)
    {
        Iterator iter = set.iterator();
        while ( iter.hasNext() )
        {
            Permission permission = (Permission)iter.next();
            if ( permissionName != null  &&
                 permissionName.equals( ((SecurityObject)permission).getName() ) )
            {
                return true;
            }
View Full Code Here

    public Permission getPermission(String permissionName)
    {
        Iterator iter = set.iterator();
        while ( iter.hasNext() )
        {
            Permission permission = (Permission)iter.next();
            if ( permissionName != null  &&
                 permissionName.equals( ((SecurityObject)permission).getName() ) )
            {
                return permission;
            }
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

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.