根据用户名获取相应的用户。
getUser(username)
参数
- username
表示用户名的字符串。
返回值
返回一个 ScriptUser 对象,如果找不到用户,则返回null。
代码例
var username = "joe.user";
model.scriptUser = groups.getUser(username);
上述代码返回的ScriptUser对象可以传递给以下FreeMarker模板:
<p>authorityType: ${scriptUser.authorityType}</p>
<p>shortName: ${scriptUser.shortName}</p>
<p>fullName: ${scriptUser.fullName}</p>
<p>userName: ${scriptUser.userName}</p>
<p>displayName: ${scriptUser.displayName}</p>
<p>personNodeRef: ${scriptUser.personNodeRef}</p>
<p>person.properties.name: ${scriptUser.person.properties.name}</p>
<p>person.type: ${scriptUser.person.type}</p>
上述FreeMarker代码将显示类似于以下内容的结果:
authorityType: USER
shortName: joe.user
fullName: joe.user
userName: joe.user
displayName: joe.user
personNodeRef: workspace://SpacesStore/4d7abb60-d8ff-4fcf-956f-93e53ebafed0
person.properties.name: 4d7abb60-d8ff-4fcf-956f-93e53ebafed0
person.type: {http://www.alfresco.org/model/content/1.0}person
文档更新时间: 2019-07-09 12:22 作者:凌云文档