Hướng dẫn phân quyền dữ liệu theo nhóm user
Tại sao cần phân quyền dữ liệu theo nhóm User?
CÁC BƯỚC THỰC HIỆN:
Step 1: Check phân quyền chức năng
Step 2: Sửa file dic muốn phân quyền
VD: file list.dic
DEMO: PHÂN QUYỀN DỮ LIỆU THEO NHÓM USER
- Admin và nhóm HTcó quyền xem danh sách.
- Admin có quyền sửa duyệt, nhóm user HT thì không.
➔ ẩn cột xử lý với nhóm HT không có quyền sửa.
Step 1: Check phân quyền chức năng quản lý phòng ban:
Tìm chức năng quản lý phòng ban (Quản lý NSD & Phân quyền-> Danh mục chức năng)
KẾT QUẢ:
SOURCE CODE:
DefaultOrderField==CREATED
DefaultOrderType==DESC
Html
HiddenFields=:
:{
!session = action.getRequest().getSession();
userId = action.getParameters().get("session.userId");
if(userId == null || userId.equals(""))
{
userId = "";
session.setAttribute("userId",userId);
}
userIdValue = -1;
if(userId != null && !userId.equals(""))
userIdValue = java.lang.Integer.valueOf(userId);
session.setAttribute("userIdValue", userIdValue);
associatedGroups = session.getAttribute("associatedGroups");
if(associatedGroups == null)
{
associatedGroups = new java.util.ArrayList();
groupAnonymous = com.ftl.wak.mgr.AdmHelper.getInstance().getGroup("Anonymous");
if(groupAnonymous != null)
associatedGroups.add(groupAnonymous.getId());
session.setAttribute("associatedGroups",associatedGroups);
}
groupIdentified = com.ftl.wak.mgr.AdmHelper.getInstance().getGroup("Identified");
if(groupIdentified != null)
{
if(associatedGroups.indexOf(groupIdentified.getId()) < 0)
associatedGroups.add(groupIdentified.getId());
}
session.setAttribute("associatedGroups", associatedGroups);
updatePermission = com.ftl.wak.mgr.AdmHelper.getInstance().getModulePermission( userIdValue,associatedGroups,"com.ftl.ppm.center_region");
hiddenField = "";
if(updatePermission.indexOf("U") < 0)
hiddenField += "PROCESS";
hiddenField;
:}
# MaximumRowFetched==20
#Json
# MaximumRowFetched==20