Ejemplo n.º 1
0
  // Permissions
  public void permissions() {
    int id = this.request.getIntParameter("group_id");

    PermissionControl pc = new PermissionControl();
    pc.setRoles(DataAccessDriver.getInstance().newGroupSecurityDAO().loadRoles(id));

    String xmlconfig = SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/permissions.xml";
    List sections = new XMLPermissionControl(pc).loadConfigurations(xmlconfig);

    GroupDAO gm = DataAccessDriver.getInstance().newGroupDAO();

    this.context.put("sections", sections);
    this.context.put("group", gm.selectById(id));
    this.setTemplateName(TemplateKeys.GROUP_PERMISSIONS);
  }
Ejemplo n.º 2
0
  public void permissionsSave() {
    int id = this.request.getIntParameter("id");

    GroupSecurityDAO gmodel = DataAccessDriver.getInstance().newGroupSecurityDAO();

    PermissionControl pc = new PermissionControl();
    pc.setSecurityModel(gmodel);

    new PermissionProcessHelper(pc, id).processData();

    SecurityRepository.clean();
    RolesRepository.clear();
    ForumRepository.clearModeratorList();

    this.list();
  }