|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.processor.BaseProcessorExtension
org.alfresco.repo.jscript.BaseScopableProcessorExtension
org.alfresco.repo.jscript.People
public final class People
Scripted People service for describing and executing actions against People & Groups.
Constructor Summary | |
---|---|
People()
|
Method Summary | |
---|---|
void |
addAuthority(ScriptNode parentGroup,
ScriptNode authority)
Add an authority (a user or group) to a group container as a new child |
void |
afterPropertiesSet()
|
void |
changePassword(java.lang.String oldPassword,
java.lang.String newPassword)
Change the password for the currently logged in user. |
ScriptNode |
createGroup(ScriptNode parentGroup,
java.lang.String groupName)
Create a new group with the specified unique name |
ScriptNode |
createGroup(java.lang.String groupName)
Create a new root level group with the specified unique name |
ScriptNode |
createPerson(java.lang.String userName)
Create a Person with the given user name |
ScriptNode |
createPerson(java.lang.String userName,
java.lang.String firstName,
java.lang.String lastName,
java.lang.String emailAddress)
Create a Person with the given user name, firstName, lastName and emailAddress |
ScriptNode |
createPerson(java.lang.String userName,
java.lang.String firstName,
java.lang.String lastName,
java.lang.String emailAddress,
java.lang.String password,
boolean setAccountEnabled)
Create a Person with an optionally generated user name |
void |
deleteGroup(ScriptNode group)
Deletes a group from the system. |
void |
deletePerson(java.lang.String username)
Delete a Person with the given username |
void |
disableAccount(java.lang.String userName)
Disable user account. |
void |
enableAccount(java.lang.String userName)
Enable user account. |
java.util.Map |
getCapabilities(ScriptNode person)
Gets a map of capabilities (boolean assertions) for the given person. |
org.mozilla.javascript.Scriptable |
getContainerGroups(ScriptNode person)
Gets the groups that contain the specified authority |
ScriptNode |
getGroup(java.lang.String groupName)
Gets the Group given the group name |
ScriptableHashMap |
getImmutableProperties(java.lang.String username)
Return a map of the Person properties that are marked as immutable for the given user. |
org.mozilla.javascript.Scriptable |
getMembers(ScriptNode group)
Gets the members (people) of a group (including all sub-groups) |
org.mozilla.javascript.Scriptable |
getMembers(ScriptNode group,
boolean recurse)
Gets the members (people) of a group |
org.mozilla.javascript.Scriptable |
getPeople(java.lang.String filter)
Get the collection of people stored in the repository. |
org.mozilla.javascript.Scriptable |
getPeople(java.lang.String filter,
int maxResults)
Get the collection of people stored in the repository. |
ScriptNode |
getPerson(java.lang.String username)
Gets the Person given the username |
boolean |
isAccountEnabled(java.lang.String userName)
Return true if the specified user account is enabled. |
boolean |
isAdmin(ScriptNode person)
Return true if the specified user is an Administrator authority. |
boolean |
isGuest(ScriptNode person)
Return true if the specified user is an guest authority. |
void |
removeAuthority(ScriptNode parentGroup,
ScriptNode authority)
Remove an authority (a user or group) from a group |
void |
setAuthenticationService(MutableAuthenticationService authenticationService)
Sets the authentication service. |
void |
setAuthorityDAO(AuthorityDAO authorityDAO)
Set the authority DAO |
void |
setAuthorityService(AuthorityService authorityService)
Set the authority service |
void |
setContentUsageService(ContentUsageService contentUsageService)
|
void |
setPassword(java.lang.String userName,
java.lang.String password)
Set a password for the given user. |
void |
setPersonService(PersonService personService)
Set the person service |
void |
setQuota(ScriptNode person,
java.lang.String quota)
Set the content quota in bytes for a person. |
void |
setServiceRegistry(ServiceRegistry serviceRegistry)
Set the service registry |
void |
setStoreUrl(java.lang.String storeRef)
Set the default store reference |
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
|
void |
setUserNameGenerator(UserNameGenerator userNameGenerator)
Set the user name generator service |
void |
setUserRegistrySynchronizer(UserRegistrySynchronizer userRegistrySynchronizer)
Set the UserRegistrySynchronizer |
Methods inherited from class org.alfresco.repo.jscript.BaseScopableProcessorExtension |
---|
getScope, setScope |
Methods inherited from class org.alfresco.repo.processor.BaseProcessorExtension |
---|
getExtensionName, register, setExtensionName, setProcessor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public People()
Method Detail |
---|
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public void setStoreUrl(java.lang.String storeRef)
storeRef
- the default store referencepublic void setAuthenticationService(MutableAuthenticationService authenticationService)
authenticationService
- the authentication servicepublic void setServiceRegistry(ServiceRegistry serviceRegistry)
serviceRegistry
- the service registrypublic void setAuthorityDAO(AuthorityDAO authorityDAO)
authorityDAO
- authority daopublic void setAuthorityService(AuthorityService authorityService)
authorityService
- The authorityService to set.public void setPersonService(PersonService personService)
personService
- The personService to set.public void setContentUsageService(ContentUsageService contentUsageService)
contentUsageService
- the ContentUsageService to setpublic void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
tenantService
- the tenantService to setpublic void setUserNameGenerator(UserNameGenerator userNameGenerator)
userNameGenerator
- the user name generatorpublic void setUserRegistrySynchronizer(UserRegistrySynchronizer userRegistrySynchronizer)
userRegistrySynchronizer
- public void deletePerson(java.lang.String username)
username
- the username of the person to deletepublic ScriptNode createPerson(java.lang.String userName, java.lang.String firstName, java.lang.String lastName, java.lang.String emailAddress, java.lang.String password, boolean setAccountEnabled)
userName
- userName or null for a generated user namefirstName
- firstNamelastName
- lastNameemailAddress
- emailAddresspassword
- if not null creates a new authenticator with the given password.setAccountEnabled
- set to 'true' to create enabled user account, or 'false' to
create disabled user account for created person.
public void enableAccount(java.lang.String userName)
userName
- user name for which to enable user accountpublic void disableAccount(java.lang.String userName)
userName
- user name for which to disable user accountpublic boolean isAccountEnabled(java.lang.String userName)
userName
- user name to test account
public void changePassword(java.lang.String oldPassword, java.lang.String newPassword)
oldPassword
- Old user passwordnewPassword
- New user passwordpublic void setPassword(java.lang.String userName, java.lang.String password)
userName
- Username to change password forpassword
- Password to setpublic ScriptNode createPerson(java.lang.String userName)
userName
- the user name of the person to create
public ScriptNode createPerson(java.lang.String userName, java.lang.String firstName, java.lang.String lastName, java.lang.String emailAddress)
userName
- the user name of the person to create
public void setQuota(ScriptNode person, java.lang.String quota)
person
- Person to set quota against.quota
- As a string, in bytes, a value of "-1" means no quota is setpublic org.mozilla.javascript.Scriptable getPeople(java.lang.String filter)
filter
- filter query string by which to filter the collection of people.
If nullthen all people stored in the repository are returned
public org.mozilla.javascript.Scriptable getPeople(java.lang.String filter, int maxResults)
filter
- filter query string by which to filter the collection of people.
If nullthen all people stored in the repository are returned
maxResults
- maximum results to return or all if <= 0
public ScriptNode getPerson(java.lang.String username)
username
- the username of the person to get
public ScriptNode getGroup(java.lang.String groupName)
groupName
- name of group to get
public void deleteGroup(ScriptNode group)
group
- The group to deletepublic ScriptNode createGroup(java.lang.String groupName)
groupName
- The unique group name to create - NOTE: do not prefix with "GROUP_"
public ScriptNode createGroup(ScriptNode parentGroup, java.lang.String groupName)
parentGroup
- The parent group node - can be null for a root level groupgroupName
- The unique group name to create - NOTE: do not prefix with "GROUP_"
public void addAuthority(ScriptNode parentGroup, ScriptNode authority)
parentGroup
- The parent container groupauthority
- The authority (user or group) to addpublic void removeAuthority(ScriptNode parentGroup, ScriptNode authority)
parentGroup
- The parent container groupauthority
- The authority (user or group) to removepublic org.mozilla.javascript.Scriptable getMembers(ScriptNode group)
group
- the group to retrieve members forrecurse
- recurse into sub-groups
public org.mozilla.javascript.Scriptable getMembers(ScriptNode group, boolean recurse)
group
- the group to retrieve members forrecurse
- recurse into sub-groups
public org.mozilla.javascript.Scriptable getContainerGroups(ScriptNode person)
person
- the user (cm:person) to get the containing groups for
public boolean isAdmin(ScriptNode person)
person
- to test
public boolean isGuest(ScriptNode person)
person
- to test
public java.util.Map getCapabilities(ScriptNode person)
person
- the person
public ScriptableHashMap getImmutableProperties(java.lang.String username)
username
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |