public DepositFrame(MainFrame parent, IFinCo model, IAccount account, int rowIndex) {
    super(parent);
    this.model = model;
    this.account = account;
    this.rowIndex = rowIndex;
    // This code is automatically generated by Visual Cafe when you add
    // components to the visual environment. It instantiates and initializes
    // the components. To modify the code, only use code syntax that matches
    // what Visual Cafe can generate, or Visual Cafe may be unable to back
    // parse your Java file into its visual environment.
    // {{INIT_CONTROLS
    setTitle("Deposit");
    setModal(true);
    getContentPane().setLayout(null);
    setSize(268, 126);
    setVisible(false);
    JLabel1.setText("Acc Nr");
    getContentPane().add(JLabel1);
    JLabel1.setForeground(java.awt.Color.black);
    JLabel1.setBounds(12, 12, 48, 24);
    JLabel2.setText("Amount");
    getContentPane().add(JLabel2);
    JLabel2.setForeground(java.awt.Color.black);
    JLabel2.setBounds(12, 48, 48, 24);
    JTextField_NAME.setEditable(false);
    getContentPane().add(JTextField_NAME);
    JTextField_NAME.setBounds(84, 12, 144, 24);
    JButton_OK.setText("OK");
    JButton_OK.setActionCommand("OK");
    getContentPane().add(JButton_OK);
    JButton_OK.setBounds(36, 84, 84, 24);
    JButton_Cancel.setText("Cancel");
    JButton_Cancel.setActionCommand("Cancel");
    getContentPane().add(JButton_Cancel);
    JButton_Cancel.setBounds(156, 84, 84, 24);
    getContentPane().add(JTextField_Deposit);
    JTextField_Deposit.setBounds(84, 48, 144, 24);
    // }}
    JTextField_NAME.setText(account.getAccNumber().toString());

    // {{REGISTER_LISTENERS
    SymAction lSymAction = new SymAction();
    JButton_OK.addActionListener(lSymAction);
    JButton_Cancel.addActionListener(lSymAction);
    // }}
  }
Exemple #2
0
    public static void checkPermission(String key, boolean allowSystem) throws NoAccessException {
      long l = 0;
      if (Plugin.logCheckTime && Logger.isDebugEnabled()) {
        Plugin.debug(">>>>>>> [%s]", key);
        l = System.currentTimeMillis();
      }
      if (Boolean.parseBoolean(Play.configuration.getProperty(ConfigConstants.DISABLE, "false"))) {
        return;
      }

      IAuthorizeable a = reg_.get(key);
      if (null == a) {
        throw new RuntimeException("oops, something wrong with enhancer... ?");
      }
      IAccount acc = null;
      try {
        IAccount accFact = AAAFactory.account();
        acc = accFact.getCurrent();
        if (null == acc) {
          if (allowSystem) {
            if (!Boolean.parseBoolean(
                Play.configuration.getProperty(ConfigConstants.SYSTEM_PERMISSION_CHECK, "false"))) {
              // suppress permission check for system account
              return;
            }
            acc = accFact.getSystemAccount();
          }
          if (null == acc) {
            throw new NoAccessException("cannot determine principal account");
          }
        }

        // superuser check
        boolean isSuperUser = false;
        if (Plugin.superuser > 0) {
          IPrivilege p = acc.getPrivilege();
          if (null != p) isSuperUser = p.getLevel() >= Plugin.superuser;
        }
        if (!isSuperUser && !acc.hasAccessTo(a)) {
          throw new NoAccessException("Access denied");
        }
      } catch (NoAccessException nae) {
        throw nae;
      } catch (Exception e) {
        throw new NoAccessException(e);
      } finally {
        if (Plugin.logCheckTime && Logger.isDebugEnabled()) {
          Plugin.debug("<<<<<<< [%s]: %sms", key, System.currentTimeMillis() - l);
        }
      }
    }