com.imcode.imcms.api
Class UserService
java.lang.Object
com.imcode.imcms.api.UserService
public class UserService
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UserService
public UserService(ContentManagementSystem contentManagementSystem)
getAllUsers
public User[] getAllUsers()
throws NoPermissionException
- Throws:
NoPermissionException
getUsersWithRole
public java.util.List<User> getUsersWithRole(Role role)
getUser
public User getUser(int userId)
- Parameters:
userId -
- Returns:
- User with the specified id, or null if none.
getUser
public User getUser(java.lang.String userLoginName)
- Parameters:
userLoginName -
- Returns:
- User with the specified login name, or null if none.
getAllRoles
public Role[] getAllRoles()
throws NoPermissionException
- Throws:
NoPermissionException- Since:
- 2.0
getRole
public Role getRole(int roleId)
- Since:
- 2.0
getRole
public Role getRole(java.lang.String roleName)
- Since:
- 2.0
deleteRole
public void deleteRole(Role role)
throws NoPermissionException
- Throws:
NoPermissionException- Since:
- 2.0
getAllUsersWithRole
public User[] getAllUsersWithRole(Role role)
throws NoPermissionException
- Throws:
NoPermissionException- Since:
- 2.0
createNewRole
public Role createNewRole(java.lang.String roleName)
- Since:
- 2.0
saveRole
public void saveRole(Role role)
throws NoPermissionException,
SaveException
- Throws:
NoPermissionException - unless superadmin.
AlreadyExistsException - if another role with the same name exists.
SaveException - if the name is too long.- Since:
- 2.0
createNewUser
public User createNewUser(java.lang.String loginName,
java.lang.String password)
- Create a new user. Don't forget to call
saveUser(User).
- Parameters:
loginName - The user's login namepassword - The user's password
- Returns:
- A new user
saveUser
public void saveUser(User user)
throws NoPermissionException,
SaveException
- Throws:
NoPermissionException
SaveException
updateUserSession
public void updateUserSession(User user)
sendPasswordReminderMail
public void sendPasswordReminderMail(User user,
java.lang.String fromAddress,
java.lang.String subject,
java.lang.String body,
java.lang.String bodyPasswordPlaceHolderRegex)
throws MailException
- Send a password reminder mail
- Parameters:
user - The user to send mail tofromAddress - The address to send fromsubject - The subject of the mailbody - The body of the mail, containing a placeholder for the passwordbodyPasswordPlaceHolderRegex - Is replaced with the password in the body.
- Throws:
MailException