Search in sources :

Example 1 with RoleMap

use of app.hongs.serv.auth.RoleMap in project HongsCORE by ihongs.

the class DeptAction method getInfo.

@Action("info")
public void getInfo(ActionHelper helper) throws HongsException {
    Map rd = helper.getRequestData();
    String id = helper.getParameter("id");
    String nc = helper.getParameter("navi-conf");
    String ud = (String) helper.getSessibute(Cnst.UID_SES);
    if (id != null && id.length() != 0) {
        rd = model.getInfo(rd);
    } else {
        rd = new HashMap();
    }
    // With all roles
    if (nc != null && nc.length() != 0) {
        List rs = !Cnst.ADM_UID.equals(ud) ? new RoleMap(NaviMap.getInstance(nc)).getRoleTranslated() : new RoleMap(NaviMap.getInstance(nc)).getRoleTranslates();
        Dict.put(rd, rs, "enum", "roles..role");
    }
    helper.reply(rd);
}
Also used : HashMap(java.util.HashMap) List(java.util.List) HashMap(java.util.HashMap) NaviMap(app.hongs.action.NaviMap) Map(java.util.Map) RoleMap(app.hongs.serv.auth.RoleMap) RoleMap(app.hongs.serv.auth.RoleMap) Action(app.hongs.action.anno.Action)

Example 2 with RoleMap

use of app.hongs.serv.auth.RoleMap in project HongsCORE by ihongs.

the class UserAction method getInfo.

@Action("info")
public void getInfo(ActionHelper helper) throws HongsException {
    Map rd = helper.getRequestData();
    String id = helper.getParameter("id");
    String nc = helper.getParameter("navi-conf");
    String ud = (String) helper.getSessibute(Cnst.UID_SES);
    if (id != null && id.length() != 0) {
        rd = model.getInfo(rd);
    } else {
        rd = new HashMap();
    }
    // With all roles
    if (nc != null && nc.length() != 0) {
        List rs = !Cnst.ADM_UID.equals(ud) ? new RoleMap(NaviMap.getInstance(nc)).getRoleTranslated() : new RoleMap(NaviMap.getInstance(nc)).getRoleTranslates();
        Dict.put(rd, rs, "enum", "roles..role");
    }
    // Remove the password field, don't show password in page
    Map info = (Map) rd.get("info");
    if (info != null) {
        info.remove("password");
        info.remove("passcode");
    }
    helper.reply(rd);
}
Also used : HashMap(java.util.HashMap) List(java.util.List) HashMap(java.util.HashMap) NaviMap(app.hongs.action.NaviMap) Map(java.util.Map) RoleMap(app.hongs.serv.auth.RoleMap) RoleMap(app.hongs.serv.auth.RoleMap) Action(app.hongs.action.anno.Action)

Aggregations

NaviMap (app.hongs.action.NaviMap)2 Action (app.hongs.action.anno.Action)2 RoleMap (app.hongs.serv.auth.RoleMap)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2