Examples of ApplicationAcls


Examples of org.coweb.admin.acls.ApplicationAcls

     
      int appid = this.getAppidFromTitle(appTitle);
      if(appid == -1)
        return -1;
     
      ApplicationAcls appAcls = this.getApplicationAclsForUser(username, appid);
      if(!appAcls.canHostApp())
        throw new SecurityException("User " + username + " is not allowed to create sessions");
     
      PreparedStatement stmt = null;
        int sessionId = -1;
       
View Full Code Here

Examples of org.coweb.admin.acls.ApplicationAcls

    }
   
    private ApplicationAcls getApplicationAclsForUser(String username, int appid) {
      PreparedStatement stmt = null;
        ResultSet rs = null;
        ApplicationAcls appAcls = null;
      
        try {
            stmt = conn.prepareStatement("SELECT acls FROM applicationacls " +
                "WHERE (appid = ? AND username = ?)",
          ResultSet.TYPE_FORWARD_ONLY,
                    ResultSet.CONCUR_READ_ONLY);

            stmt.setInt(1, appid);
            stmt.setString(2, username);
           
            rs = stmt.executeQuery();
            int acls;
            if(rs.next()) {
              acls = rs.getInt(1);
              appAcls = new ApplicationAcls(acls);
            }
            else {
              rs.close();
              stmt.setString(2, "ALL");
              rs = stmt.executeQuery();
              if(rs.next()) {
                acls = rs.getInt(1);
                appAcls = new ApplicationAcls(acls);
              }
            }   
        }
        catch (Exception e) {
        }
        finally {
      if (rs != null) {
        try {
          rs.close();
        } catch (SQLException sqlEx) { } // ignore
        rs = null;
      }
      if (stmt != null) {
        try {
          stmt.close();
        } catch (SQLException sqlEx) { } // ignore
        stmt = null;
      }
    }
       
        //default to no permissions.
        if(appAcls == null)
          appAcls = new ApplicationAcls();
       
      return appAcls;
    }
View Full Code Here

Examples of org.coweb.admin.acls.ApplicationAcls

     
      int appid = this.getAppidFromTitle(appTitle);
      if(appid == -1)
        return -1;
     
      ApplicationAcls appAcls = this.getApplicationAclsForUser(username, appid);
      if(!appAcls.canHostApp())
        throw new SecurityException("User " + username + " is not allowed to create sessions");
     
      PreparedStatement stmt = null;
        int sessionId = -1;
       
View Full Code Here

Examples of org.coweb.admin.acls.ApplicationAcls

    }
   
    private ApplicationAcls getApplicationAclsForUser(String username, int appid) {
      PreparedStatement stmt = null;
        ResultSet rs = null;
        ApplicationAcls appAcls = null;
      
        try {
            stmt = conn.prepareStatement("SELECT acls FROM applicationacls " +
                "WHERE (appid = ? AND username = ?)",
          ResultSet.TYPE_FORWARD_ONLY,
                    ResultSet.CONCUR_READ_ONLY);

            stmt.setInt(1, appid);
            stmt.setString(2, username);
           
            rs = stmt.executeQuery();
            int acls;
            if(rs.next()) {
              acls = rs.getInt(1);
              appAcls = new ApplicationAcls(acls);
            }
            else {
              rs.close();
              stmt.setString(2, "ALL");
              rs = stmt.executeQuery();
              if(rs.next()) {
                acls = rs.getInt(1);
                appAcls = new ApplicationAcls(acls);
              }
            }   
        }
        catch (Exception e) {
        }
        finally {
      if (rs != null) {
        try {
          rs.close();
        } catch (SQLException sqlEx) { } // ignore
        rs = null;
      }
      if (stmt != null) {
        try {
          stmt.close();
        } catch (SQLException sqlEx) { } // ignore
        stmt = null;
      }
    }
       
        //default to no permissions.
        if(appAcls == null)
          appAcls = new ApplicationAcls();
       
      return appAcls;
    }
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.