JobDataMap createJobDataMap(String parameters) {
   JobDataMap map = new JobDataMap();
   if (!StringUtils.isNullOrEmpty(parameters)) {
     JSONArray jsonArray = JSON.parseArray(parameters);
     for (int i = 0; i < jsonArray.size(); i++) {
       JSONObject o = jsonArray.getJSONObject(i);
       map.put(o.getString("key"), o.get("value"));
     }
   }
   return map;
 }
Ejemplo n.º 2
0
 /**
  * 判断此用户是否拥有对指定模块的访问权限
  *
  * @param mId 模块id
  * @param actions 访问级别
  * @return 是否能够访问
  */
 public boolean hasAccessModuleAction(String mId, String... actions) {
   if (!hasAccessModule(mId)) return false;
   if (actions == null || actions.length == 0) return hasAccessModule(mId);
   Set<String> lv = roleInfo.get(getModule(mId));
   if (lv != null)
     for (String action : actions) {
       if (StringUtils.isNullOrEmpty(action)) return true;
       if (lv.contains(action)) return true;
     }
   return false;
 }