Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.CatalogPermBean


   * @param user_id
   * @param role
   * @throws SQLException
   */
  public static void createPermission(int catalog_id, int user_id, int role){
    CatalogPermBean cpb = new CatalogPermBean();
    cpb.setRole(role);
    cpb.setKey(new CatalogUserKey(catalog_id, user_id));
    saveOrUpdate(cpb);
  }
View Full Code Here


  private static int getUserRoleInCatalog(List perms, CatalogBean catalog,
      SessionUserObject user) {
    if(catalog==null || user==null || perms==null)
      return -1;
    for (int i = 0; i < perms.size(); i++) {
      CatalogPermBean perm = (CatalogPermBean) perms.get(i);
      if (perm.getKey().getCatalog() == catalog.getId()
          && perm.getKey().getUser() == user.getId())
        return perm.getRole();
    }
    return -1;
  }
View Full Code Here

TOP

Related Classes of com.liusoft.dlog4j.beans.CatalogPermBean

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.