Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkSecurityGroups() {
- answer = false;
- if (gs.getSession().isLoggedIn()) {
- if (current.getTableName() == 'cmdb_running_process' || current.getTableName() == 'cmdb_tcp_connection' || current.getTableName() == 'cmdb_tcp_half') {
- answer = checkSecurityRights('current.computer');
- } else if (current.getTableName() == 'cmdb_ci_windows_service') {
- answer = checkSecurityRights('current.cmdb_ci');
- } else if (current.getTableName() == 'cmdb_software_instance') {
- answer = checkSecurityRights('current.installed_on');
- } else {
- answer = checkSecurityRights('current');
- }
- }
- return answer;
- }
- function checkSecurityRights(securityItem) {
- if (eval(securityItem + '.u_security_pci') == true || eval(securityItem + '.u_security_sox') == true || eval(securityItem + '.u_security_high_risk') == true) {
- if (eval(securityItem + '.u_security_pci') == true) {
- result = gs.getUser().isMemberOf('Security-PCI');
- }
- if (eval(securityItem + '.u_security_sox') == true) {
- result = gs.getUser().isMemberOf('Security-SOX');
- }
- if (eval(securityItem + '.u_security_high_risk') == true) {
- result = gs.getUser().isMemberOf('Security-HighRisk');
- }
- } else {
- result = true; //No security flags set, answer true
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment