Changeset 33711
- Timestamp:
- 2019-11-21T14:20:57+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/UserContext.java
r27617 r33711 3 3 import org.w3c.dom.Element; 4 4 import org.w3c.dom.NodeList; 5 import org.apache.commons.lang3.StringUtils; 5 6 6 7 public class UserContext … … 10 11 protected String _lang = null; 11 12 protected String[] _groups = null; 13 protected String _editEnabled = null; 12 14 13 15 public UserContext() … … 26 28 _lang = userContext.getAttribute(GSXML.LANG_ATT); 27 29 _groups = userContext.getAttribute(GSXML.GROUPS_ATT).split(","); 30 _editEnabled = userContext.getAttribute(GSXML.EDIT_ENABLED_ATT); 28 31 } 29 32 } 30 33 31 public UserContext(String lang, String username, String userID, String[] groups)34 public UserContext(String lang, String username, String userID, String[] groups, String editEnabled) 32 35 { 33 36 _userID = userID; … … 35 38 _lang = lang; 36 39 _groups = groups; 40 _editEnabled = editEnabled; 37 41 } 38 42 … … 57 61 } 58 62 63 public void setEditEnabled(String editEnabled) 64 { 65 _editEnabled = editEnabled; 66 } 67 59 68 public String getLanguage() 60 69 { … … 92 101 return new String[0]; 93 102 } 103 public String getGroupsString() 104 { 105 if (_groups != null) 106 { 107 return StringUtils.join(_groups, ","); 108 } 109 return ""; 110 } 111 112 public String getEditEnabled() 113 { 114 if (_editEnabled != null) { 115 return _editEnabled; 116 } 117 return "false"; 118 } 94 119 }
Note:
See TracChangeset
for help on using the changeset viewer.