Project

General

Profile

« Previous | Next » 

Revision 5103

Added by daigle over 14 years ago

Verify we are in the permission and principal sections before setting values on dao object.

View differences:

DocInfoHandler.java
48 48
	private XMLAccessDAO _currentAccessDAO = null;
49 49
	private String _accessPermOrder;
50 50
	private String _docId;
51
	private boolean _inPrincipal = false;
52
	private boolean _inPermission = false;
51 53
  
52 54
	private Vector<XMLAccessDAO> xmlAccessDAOList = new Vector<XMLAccessDAO>();
53 55
  
......
71 73
			_currentAccessDAO = new XMLAccessDAO();
72 74
			_currentAccessDAO.setDocId(_docId);
73 75
			_currentAccessDAO.setPermOrder(_accessPermOrder);
76
		} else if (_currentTag.equals(AccessControlInterface.PRINCIPAL)) {
77
			_inPrincipal = true;
78
		} else if (_currentTag.equals(AccessControlInterface.PERMISSION)) {
79
			_inPermission = true;
74 80
		}
75 81
	}
76 82

  
......
89 95
			if (_currentAccessDAO != null) {
90 96
				_currentAccessDAO.setPermType(AccessControlInterface.DENY);
91 97
			}
98
		} else if (_currentTag.equals(AccessControlInterface.PRINCIPAL)) {
99
			_inPrincipal = false;
100
		} else if (_currentTag.equals(AccessControlInterface.PERMISSION)) {
101
			_inPermission = false;
92 102
		}
93 103
	}
94 104
  
......
100 110
  {
101 111
    _docinfo.put(_currentTag, new String(ch, start, length));
102 112
    	
103
    if (_currentTag.equals(AccessControlInterface.PRINCIPAL)) {
113
    if (_currentTag.equals(AccessControlInterface.PRINCIPAL) && _inPrincipal) {
104 114
		if (_currentAccessDAO != null) {
105 115
			_currentAccessDAO.setPrincipalName(new String(ch, start, length));
106 116
		}
107
	} else if (_currentTag.equals(AccessControlInterface.PERMISSION)) {
117
	} else if (_currentTag.equals(AccessControlInterface.PERMISSION) && _inPermission) {
108 118
		if (_currentAccessDAO != null) {
109 119
			String permString = new String(ch, start, length);
110 120
			Long permLong = Long.valueOf(AccessControlList.intValue(permString));

Also available in: Unified diff