Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.PermissionManager


     * @throws SerializerException
     */
    private void recreatePermissions() throws SerializerException
    {
      logMe("recreatePermissions - started");
        PermissionManager pm = (PermissionManager) getCM()
                .getComponent("org.apache.jetspeed.security.PermissionManager");
        if (pm == null)
            throw new SerializerException(
                    SerializerException.COMPONENTMANAGER_DOES_NOT_EXIST
                            .create("org.apache.jetspeed.security.PermissionManager"));

        Iterator list = null;
        try
        {
          list = ((JSSeedData)getSnapshot()).getPermissions().iterator();
        } catch (Exception e)
        {
            throw new SerializerException(
                    SerializerException.GET_EXISTING_OBJECTS
                            .create(new String[]
                            { "Permissions", e.getMessage()}));
        }

        while (list.hasNext())
        {
            JSPermission _js = (JSPermission)list.next();
            PortalResourcePermission perm = _js.getPermissionForType();
            if ((perm != null) && (perm instanceof PortalResourcePermission))
            {
              try
                {
                    pm.addPermission(perm);
                    ArrayList listTemp = null;
          JSUserGroups jsUserGroups = _js.getGroupString();
          if (jsUserGroups != null)
            listTemp = this.getTokens(jsUserGroups.toString());
          else
            listTemp = null;
          if ((listTemp != null) && (listTemp.size()>0))
          {
            Iterator _itTemp = listTemp.iterator();
            while (_itTemp.hasNext())
            {
              Principal p = (Principal)this.groupMap.get((String)_itTemp.next());
              if (p != null)
                pm.grantPermission(p, perm);
            }
          }
          JSUserRoles jsUserRoles = _js.getRoleString();
          if (jsUserRoles != null)
            listTemp = this.getTokens(jsUserRoles.toString());
          else
            listTemp = null;
          if ((listTemp != null) && (listTemp.size()>0))
          {
            Iterator _itTemp = listTemp.iterator();
            while (_itTemp.hasNext())
            {
                 Principal p = (Principal)this.roleMap.get((String)_itTemp.next());
              if (p != null)
                pm.grantPermission(p, perm);
            }
          }
          JSUserUsers jsUserUsers = _js.getUserString();
          if (jsUserUsers != null)
            listTemp = this.getTokens(jsUserUsers.toString());
          else
            listTemp = null;
          if ((listTemp != null) && (listTemp.size()>0))
          {
            Iterator _itTemp = listTemp.iterator();
            while (_itTemp.hasNext())
            {
                 Principal p = (Principal)this.userMap.get((String)_itTemp.next());
              if (p != null)
                pm.grantPermission(p, perm);
            }
          }

              }
               catch (Exception e)
View Full Code Here


     * @throws SerializerException
     */
    private void getPermissions() throws SerializerException
    {
        Object o = null;
        PermissionManager pm = (PermissionManager) getCM()
                .getComponent("org.apache.jetspeed.security.PermissionManager");
        if (pm == null)
            throw new SerializerException(
                    SerializerException.COMPONENTMANAGER_DOES_NOT_EXIST
                            .create("org.apache.jetspeed.security.PermissionManager"));

        Iterator list = null;
        try
        {
            list = pm.getPermissions().iterator();
        } catch (Exception e)
        {
            throw new SerializerException(
                    SerializerException.GET_EXISTING_OBJECTS
                            .create(new String[]
View Full Code Here

     * @throws SerializerException
     */
    private void recreatePermissions() throws SerializerException
    {
      logMe("recreatePermissions - started");
        PermissionManager pm = (PermissionManager) getCM()
                .getComponent("org.apache.jetspeed.security.PermissionManager");
        if (pm == null)
            throw new SerializerException(
                    SerializerException.COMPONENTMANAGER_DOES_NOT_EXIST
                            .create("org.apache.jetspeed.security.PermissionManager"));

        Iterator list = null;
        JSPermissions permissions = ((JSSeedData)getSnapshot()).getPermissions();
        if (permissions != null)
        {
           list =  permissions.iterator();
            while (list.hasNext())
            {
                JSPermission _js = (JSPermission)list.next();
                PortalResourcePermission perm = _js.getPermissionForType();
                if ((perm != null) && (perm instanceof PortalResourcePermission))
                {
                  try
                    {
                        pm.addPermission(perm);
                        ArrayList listTemp = null;
              JSUserGroups jsUserGroups = _js.getGroupString();
              if (jsUserGroups != null)
                listTemp = this.getTokens(jsUserGroups.toString());
              else
                listTemp = null;
              if ((listTemp != null) && (listTemp.size()>0))
              {
                Iterator _itTemp = listTemp.iterator();
                while (_itTemp.hasNext())
                {
                  Principal p = (Principal)this.groupMap.get((String)_itTemp.next());
                  if (p != null)
                    pm.grantPermission(p, perm);
                }
              }
              JSUserRoles jsUserRoles = _js.getRoleString();
              if (jsUserRoles != null)
                listTemp = this.getTokens(jsUserRoles.toString());
              else
                listTemp = null;
              if ((listTemp != null) && (listTemp.size()>0))
              {
                Iterator _itTemp = listTemp.iterator();
                while (_itTemp.hasNext())
                {
                     Principal p = (Principal)this.roleMap.get((String)_itTemp.next());
                  if (p != null)
                    pm.grantPermission(p, perm);
                }
              }
              JSUserUsers jsUserUsers = _js.getUserString();
              if (jsUserUsers != null)
                listTemp = this.getTokens(jsUserUsers.toString());
              else
                listTemp = null;
              if ((listTemp != null) && (listTemp.size()>0))
              {
                Iterator _itTemp = listTemp.iterator();
                while (_itTemp.hasNext())
                {
                     Principal p = (Principal)this.userMap.get((String)_itTemp.next());
                  if (p != null)
                    pm.grantPermission(p, perm);
                }
              }
   
                  }
                   catch (Exception e)
View Full Code Here

     * @throws SerializerException
     */
    private void getPermissions() throws SerializerException
    {
        Object o = null;
        PermissionManager pm = (PermissionManager) getCM()
                .getComponent("org.apache.jetspeed.security.PermissionManager");
        if (pm == null)
            throw new SerializerException(
                    SerializerException.COMPONENTMANAGER_DOES_NOT_EXIST
                            .create("org.apache.jetspeed.security.PermissionManager"));

        Iterator list = null;
        try
        {
            list = pm.getPermissions().iterator();
        } catch (Exception e)
        {
            throw new SerializerException(
                    SerializerException.GET_EXISTING_OBJECTS
                            .create(new String[]
View Full Code Here

     */
    private void recreatePermissions() throws SerializerException
    {
      logMe("recreatePermissions - started");
        Object o = null;
        PermissionManager pm = (PermissionManager) getCM()
                .getComponent("org.apache.jetspeed.security.PermissionManager");
        if (pm == null)
            throw new SerializerException(
                    SerializerException.COMPONENTMANAGER_DOES_NOT_EXIST
                            .create("org.apache.jetspeed.security.PermissionManager"));

        Iterator list = null;
        try
        {
          list = ((JSSeedData)getSnapshot()).getPermissions().iterator();
        } catch (Exception e)
        {
            throw new SerializerException(
                    SerializerException.GET_EXISTING_OBJECTS
                            .create(new String[]
                            { "Permissions", e.getMessage()}));
        }

        while (list.hasNext())
        {
            JSPermission _js = (JSPermission)list.next();
            PortalResourcePermission perm = _js.getPermissionForType();
            if ((perm != null) && (perm instanceof PortalResourcePermission))
            {
              try
                {
                    pm.addPermission(perm);
                    ArrayList listTemp = null;
          JSUserGroups jsUserGroups = _js.getGroupString();
          if (jsUserGroups != null)
            listTemp = this.getTokens(jsUserGroups.toString());
          else
            listTemp = null;
          if ((listTemp != null) && (listTemp.size()>0))
          {
            Iterator _itTemp = listTemp.iterator();
            while (_itTemp.hasNext())
            {
              Principal p = (Principal)this.groupMap.get((String)_itTemp.next());
              if (p != null)
                pm.grantPermission(p, perm);
            }
          }
          JSUserRoles jsUserRoles = _js.getRoleString();
          if (jsUserRoles != null)
            listTemp = this.getTokens(jsUserRoles.toString());
          else
            listTemp = null;
          if ((listTemp != null) && (listTemp.size()>0))
          {
            Iterator _itTemp = listTemp.iterator();
            while (_itTemp.hasNext())
            {
                 Principal p = (Principal)this.roleMap.get((String)_itTemp.next());
              if (p != null)
                pm.grantPermission(p, perm);
            }
          }
          JSUserUsers jsUserUsers = _js.getUserString();
          if (jsUserUsers != null)
            listTemp = this.getTokens(jsUserUsers.toString());
          else
            listTemp = null;
          if ((listTemp != null) && (listTemp.size()>0))
          {
            Iterator _itTemp = listTemp.iterator();
            while (_itTemp.hasNext())
            {
                 Principal p = (Principal)this.userMap.get((String)_itTemp.next());
              if (p != null)
                pm.grantPermission(p, perm);
            }
          }

              }
               catch (Exception e)
View Full Code Here

     * @throws SerializerException
     */
    private void getPermissions() throws SerializerException
    {
        Object o = null;
        PermissionManager pm = (PermissionManager) getCM()
                .getComponent("org.apache.jetspeed.security.PermissionManager");
        if (pm == null)
            throw new SerializerException(
                    SerializerException.COMPONENTMANAGER_DOES_NOT_EXIST
                            .create("org.apache.jetspeed.security.PermissionManager"));

        Iterator list = null;
        try
        {
            list = pm.getPermissions().iterator();
        } catch (Exception e)
        {
            throw new SerializerException(
                    SerializerException.GET_EXISTING_OBJECTS
                            .create(new String[]
View Full Code Here

     * @throws SerializerException
     */
    private void recreatePermissions() throws SerializerException
    {
      logMe("recreatePermissions - started");
        PermissionManager pm = (PermissionManager) getCM()
                .getComponent("org.apache.jetspeed.security.PermissionManager");
        if (pm == null)
            throw new SerializerException(
                    SerializerException.COMPONENTMANAGER_DOES_NOT_EXIST
                            .create("org.apache.jetspeed.security.PermissionManager"));

        Iterator list = null;
        JSPermissions permissions = ((JSSeedData)getSnapshot()).getPermissions();
        if (permissions != null)
        {
           list =  permissions.iterator();
            while (list.hasNext())
            {
                JSPermission _js = (JSPermission)list.next();
                PortalResourcePermission perm = _js.getPermissionForType();
                if ((perm != null) && (perm instanceof PortalResourcePermission))
                {
                  try
                    {
                        pm.addPermission(perm);
                        ArrayList listTemp = null;
              JSUserGroups jsUserGroups = _js.getGroupString();
              if (jsUserGroups != null)
                listTemp = this.getTokens(jsUserGroups.toString());
              else
                listTemp = null;
              if ((listTemp != null) && (listTemp.size()>0))
              {
                Iterator _itTemp = listTemp.iterator();
                while (_itTemp.hasNext())
                {
                  Principal p = (Principal)this.groupMap.get((String)_itTemp.next());
                  if (p != null)
                    pm.grantPermission(p, perm);
                }
              }
              JSUserRoles jsUserRoles = _js.getRoleString();
              if (jsUserRoles != null)
                listTemp = this.getTokens(jsUserRoles.toString());
              else
                listTemp = null;
              if ((listTemp != null) && (listTemp.size()>0))
              {
                Iterator _itTemp = listTemp.iterator();
                while (_itTemp.hasNext())
                {
                     Principal p = (Principal)this.roleMap.get((String)_itTemp.next());
                  if (p != null)
                    pm.grantPermission(p, perm);
                }
              }
              JSUserUsers jsUserUsers = _js.getUserString();
              if (jsUserUsers != null)
                listTemp = this.getTokens(jsUserUsers.toString());
              else
                listTemp = null;
              if ((listTemp != null) && (listTemp.size()>0))
              {
                Iterator _itTemp = listTemp.iterator();
                while (_itTemp.hasNext())
                {
                     Principal p = (Principal)this.userMap.get((String)_itTemp.next());
                  if (p != null)
                    pm.grantPermission(p, perm);
                }
              }
   
                  }
                   catch (Exception e)
View Full Code Here

     * @throws SerializerException
     */
    private void getPermissions() throws SerializerException
    {
        Object o = null;
        PermissionManager pm = (PermissionManager) getCM()
                .getComponent("org.apache.jetspeed.security.PermissionManager");
        if (pm == null)
            throw new SerializerException(
                    SerializerException.COMPONENTMANAGER_DOES_NOT_EXIST
                            .create("org.apache.jetspeed.security.PermissionManager"));

        Iterator list = null;
        try
        {
            list = pm.getPermissions().iterator();
        } catch (Exception e)
        {
            throw new SerializerException(
                    SerializerException.GET_EXISTING_OBJECTS
                            .create(new String[]
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.security.PermissionManager

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.