security_02_1312273 - ATBMHTTT-2017/lab02-lab02-1312079-1312169-1312273 GitHub Wiki

Giải pháp: Trong công ty có 5 nhóm người dùng gồm: Giám đốc, Trưởng phòng, Trưởng dự án, Trưởng chi nhánh và Nhân viên bình thường. Chúng ta sẽ tạo 5 role cho 5 nhóm người dùng này, sau đó gán role cho mã nhân viên tương ứng.

  • tạo và gán role truongDuAn_role cho từng tài khoản

create role truongDuAn_role;

grant truongDuAn_role to TDA001;

grant truongDuAn_role to TDA002;

grant truongDuAn_role to TDA003;

grant truongDuAn_role to TDA004;

grant truongDuAn_role to TDA005;

  • tạo và gán role truongPhong_role cho từng tài khoản

create role truongPhong_role;

grant truongPhong_role to TP001;

grant truongPhong_role to TP002;

grant truongPhong_role to TP003;

grant truongPhong_role to TP004;

grant truongPhong_role to TP005;

.....