Esempio n. 1
0
 public void onInit() throws Exception {
   try {
     View view = Toolkit.getToolkit().getSvdbView(Executions.getCurrent().getDesktop());
     if (!view.isAdmin()) { // 非管理员用户
       IniFile userIniFile = view.getUserIni();
       String addTopN_str =
           userIniFile.getValue(userIniFile.getSections(), UserRightId.DoTopNReportlistAdd);
       String deleteTopN_str =
           userIniFile.getValue(userIniFile.getSections(), UserRightId.DoTopNReportlistDel);
       String editTopN_str =
           userIniFile.getValue(userIniFile.getSections(), UserRightId.DoStatisticReportlistEdit);
       if (!"1".equals(addTopN_str)) {
         addTopN.setDisabled(true);
       }
       if (!"1".equals(deleteTopN_str)) {
         delete.setDisabled(true);
       }
       if (!"1".equals(editTopN_str)) {
         editFlag = false;
       }
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 }