xiatian 7 ay önce
ebeveyn
işleme
3dc25d4e2f

+ 12 - 8
install/mysql/upgrade/1.5.1.sql

@@ -62,15 +62,13 @@ INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable
 SELECT s.id,'SUBJECT_HEADER',p.`code`,1 from b_privilege p join b_school s
 where p.`code` in('exam_report_subject','exam_report_subject-total','exam_report_subject-range','exam_report_subject-college',
 'exam_report_subject-teacher','exam_report_subject-class'
-,'exam_report_subject-objective_question','exam_report_subject-subjective_question','exam_report_subject-group'
-,'exam_mark-group-help_video','exam_inspected_info-list-help_video');
+,'exam_report_subject-objective_question','exam_report_subject-subjective_question','exam_report_subject-group');
 
 INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
 SELECT s.id,'COLLEGE_ADMIN',p.`code`,1 from b_privilege p join b_school s
 where p.`code` in('exam_report_subject','exam_report_subject-total','exam_report_subject-range','exam_report_subject-college',
 'exam_report_subject-teacher','exam_report_subject-class'
-,'exam_report_subject-objective_question','exam_report_subject-subjective_question','exam_report_subject-group',
-'exam_mark-group-help_video','exam_inspected_info-list-help_video');
+,'exam_report_subject-objective_question','exam_report_subject-subjective_question','exam_report_subject-group');
 
 INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
 SELECT s.id,'SCHOOL_VIEWER',p.`code`,1 from b_privilege p join b_school s
@@ -79,18 +77,24 @@ where p.`code` in('exam_report_subject','exam_report_subject-total');
 INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
 SELECT s.id,'SCHOOL_ADMIN',p.`code`,1 from b_privilege p join b_school s
 where p.`code` in('exam_mark-group-add','exam_mark-group-edit','exam_mark-group-reset_edit'
-,'exam_mark-group-delete','user_list-help_video','exam_mark-group-help_video','exam_inspected_info-list-help_video');
+,'exam_mark-group-delete');
+
+INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
+SELECT s.id,'SCHOOL_ADMIN',p.`code`,0 from b_privilege p join b_school s
+where p.`code` in('user_list-help_video','exam_mark-group-help_video','exam_inspected_info-list-help_video');
 
 INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
 SELECT s.id,'SUBJECT_HEADER',p.`code`,0 from b_privilege p join b_school s
-where p.`code` in('exam_mark-group-add','exam_mark-group-edit','exam_mark-group-reset_edit','exam_mark-group-delete');
+where p.`code` in('exam_mark-group-add','exam_mark-group-edit','exam_mark-group-reset_edit','exam_mark-group-delete'
+,'exam_mark-group-help_video','exam_inspected_info-list-help_video');
 
 INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
 SELECT s.id,'COLLEGE_ADMIN',p.`code`,0 from b_privilege p join b_school s
-where p.`code` in('exam_mark-group-add','exam_mark-group-edit','exam_mark-group-reset_edit','exam_mark-group-delete');
+where p.`code` in('exam_mark-group-add','exam_mark-group-edit','exam_mark-group-reset_edit','exam_mark-group-delete'
+,'exam_mark-group-help_video','exam_inspected_info-list-help_video');
 
 INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
-SELECT s.id,'INSPECTOR',p.`code`,1 from b_privilege p join b_school s
+SELECT s.id,'INSPECTOR',p.`code`,0 from b_privilege p join b_school s
 where p.`code` in('exam_inspected_info-list-help_video');
 
 

+ 11 - 13
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/basic/service/impl/PrivilegeServiceImpl.java

@@ -18,12 +18,8 @@ import cn.com.qmth.stmms.biz.basic.model.Privilege;
 import cn.com.qmth.stmms.biz.basic.model.RoleInfo;
 import cn.com.qmth.stmms.biz.basic.service.PrivilegeService;
 import cn.com.qmth.stmms.biz.common.BaseQueryService;
-import cn.com.qmth.stmms.biz.config.model.SystemAuth;
-import cn.com.qmth.stmms.biz.config.service.SystemAuthService;
-import cn.com.qmth.stmms.biz.config.service.impl.SystemCache;
 import cn.com.qmth.stmms.common.enums.PrivilegeType;
 import cn.com.qmth.stmms.common.enums.Role;
-import cn.com.qmth.stmms.common.enums.SystemAuthType;
 
 @Service("privilegeService")
 public class PrivilegeServiceImpl extends BaseQueryService<Privilege> implements PrivilegeService {
@@ -41,11 +37,11 @@ public class PrivilegeServiceImpl extends BaseQueryService<Privilege> implements
     @Autowired
     private RoleInfoDao roleInfoDao;
 
-    @Autowired
-    private SystemAuthService authService;
+    // @Autowired
+    // private SystemAuthService authService;
 
-    @Autowired
-    private SystemCache authCache;
+    // @Autowired
+    // private SystemCache authCache;
 
     @Override
     public List<Privilege> getMenuPrivileges() {
@@ -83,11 +79,13 @@ public class PrivilegeServiceImpl extends BaseQueryService<Privilege> implements
         initInspectorPrivilege(schoolId);
         initSchoolViewerPrivilege(schoolId);
 
-        SystemAuth systemAuth = authService.findOne();
-        if (systemAuth != null && SystemAuthType.ONLINE.equals(systemAuth.getType()) && authCache.isAuth()) {
-            disablePrivilege(schoolId, new String[] { "user_list-help_video", "exam_mark-group-help_video",
-                    "exam_inspected_info-list-help_video" });
-        }
+        // SystemAuth systemAuth = authService.findOne();
+        // if (systemAuth != null &&
+        // SystemAuthType.ONLINE.equals(systemAuth.getType()) &&
+        // authCache.isAuth()) {
+        disablePrivilege(schoolId, new String[] { "user_list-help_video", "exam_mark-group-help_video",
+                "exam_inspected_info-list-help_video" });
+        // }
     }
 
     private void disablePrivilege(Integer schoolId, String[] codes) {