|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.objectplanet.survey.plugin.api.UserManager
public class UserManager
Manage survey system users.
| Field Summary | |
|---|---|
static int |
PERMISSION_ADMIN
Permission type: admin. |
static int |
PERMISSION_FOLDER_ADD_FOLDER
Permission type: add new folder to an existing folder |
static int |
PERMISSION_FOLDER_ADD_SURVEY
Permission type: add new survey to an existing folder |
static int |
PERMISSION_MODIFY
Permission type: modify survey/folder |
static int |
PERMISSION_READ
Permission type: read survey/folder |
static int |
PERMISSION_SURVEY_CREATE_REPORT
Permission type: create survey reports |
static int |
PERMISSION_SURVEY_DELETE_RESPONDENT
Permission type: delete survey respondents |
static int |
PERMISSION_SURVEY_INVITATION
Permission type: create survey invitations |
static int |
PERMISSION_SURVEY_VIEW_RESPONDENT
Permission type: view survey respondents |
| Constructor Summary | |
|---|---|
UserManager()
|
|
| Method Summary | |
|---|---|
static void |
addGroupMember(User user,
long userGroupId,
long userId)
Add a new member to the user group. |
static User |
createUser(User user,
java.lang.String login,
java.lang.String password,
java.lang.String email,
java.lang.String memo)
Creates a new user |
static UserGroup |
createUserGroup(User user,
java.lang.String name,
java.lang.String description)
Creates a new user group |
static void |
deleteAddQuestionLibraryPermission(User user,
long userId)
Deny permission to create question libraries for a user with id userId. |
static void |
deleteFolderPermission(User user,
long userId,
long folderId,
int permissionType)
Deny folder permission to a user with id userId. |
static void |
deleteGroupMember(User user,
long userGroupId,
long userId)
Deletes a member from the group. |
static void |
deleteSurveyPermission(User user,
long userId,
long surveyId,
int permissionType)
Deny survey permission to a user with id userId. |
static void |
deleteUser(User user,
java.lang.String login)
Deletes a user by login name |
static void |
deleteUserGroup(User user,
long userGroupId)
Deletes a user group |
static User |
getUser(java.lang.String login)
Gets the user by login name. |
static User |
getUser(java.lang.String login,
java.lang.String password)
Gets the user by login name. |
static User |
getUser(User user,
long userId)
Gets the user by id. |
static java.util.ArrayList |
getUserList(User user)
Gets all users current user has access to, sorted alphabetic The ArrayList contains ListItems with the UserId and Login values. |
static void |
grandFolderPermission(User user,
long userId,
long folderId,
int permissionType)
Grand folder permission to a user. |
static void |
grandSurveyPermission(User user,
long userId,
long surveyId,
int permissionType)
Grand survey permission to a user. |
static void |
grantAddQuestionLibraryPermission(User user,
long userId)
Grant permission to create question libraries to a user |
static void |
grantUserGroupAdminPermission(User user,
long userId,
long userGroupId)
Grant user group admin permission to a user |
static boolean |
hasFolderPermission(User user,
long userId,
long folderId,
int permissionType)
Return true is user with id userId has the specified folder permission. |
static boolean |
hasSurveyPermission(User user,
long userId,
long surveyId,
int permissionType)
Return true is user with id userId has the specified survey permission. |
static boolean |
isSuperUser(User userToCheck)
Check if the user is super user |
static boolean |
isUniqueLogin(java.lang.String login)
Check if login name is unique |
static void |
logOutUser(long userId)
Logs out user (if online) with the specified user id |
static void |
updateUser(User userToUpdate)
Update user information. |
static void |
updateUserGroup(User user,
UserGroup userGroupToUpdate)
Updates the user group. |
static boolean |
userExists(long userId)
Checks if the user with the specified user id exists. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PERMISSION_ADMIN
public static final int PERMISSION_FOLDER_ADD_FOLDER
public static final int PERMISSION_FOLDER_ADD_SURVEY
public static final int PERMISSION_MODIFY
public static final int PERMISSION_READ
public static final int PERMISSION_SURVEY_CREATE_REPORT
public static final int PERMISSION_SURVEY_VIEW_RESPONDENT
public static final int PERMISSION_SURVEY_DELETE_RESPONDENT
public static final int PERMISSION_SURVEY_INVITATION
| Constructor Detail |
|---|
public UserManager()
| Method Detail |
|---|
public static User createUser(User user,
java.lang.String login,
java.lang.String password,
java.lang.String email,
java.lang.String memo)
throws SurveySystemException,
SurveySecurityException
user - User with permission create userslogin - Login name
SurveySystemException - Thrown if the user has no permission to fulfill the operation
SurveySecurityException - If an error occurs in the application
public static void deleteUser(User user,
java.lang.String login)
throws SurveySecurityException,
SurveySystemException
user - User with permission delete userslogin - Login name
SurveySecurityException - Thrown if the user has no permission to fulfill the operation
SurveySystemException - If an error occurs in the application
public static UserGroup createUserGroup(User user,
java.lang.String name,
java.lang.String description)
throws SurveySystemException,
SurveySecurityException
user - A user with permission to create user groupsname - The user group namedescription - The user group description
SurveySystemException - Thrown if the user has no permission to fulfill the operation
SurveySecurityException - If an error occurs in the application
public static void deleteUserGroup(User user,
long userGroupId)
throws SurveySecurityException,
SurveySystemException
user - A user with permission to delete user groupsuserGroupId - The user group id
SurveySystemException - Thrown if the user has no permission to fulfill the operation
SurveySecurityException - If an error occurs in the applicationpublic static boolean isSuperUser(User userToCheck)
user -
public static User getUser(User user,
long userId)
throws SurveySystemException,
SurveySecurityException
userId - User iduser - User object
SurveySecurityException - Thrown if the user has no permission to fulfill the
operation
SurveySystemException - If an error occurs in the application
public static User getUser(java.lang.String login)
throws SurveySystemException,
SurveySecurityException
SurveySecurityException will be thrown.
login - Login name
SurveySecurityException - Thrown if the login doesn't match with the user's login
name.
SurveySystemException - If an error occurs in the application
public static User getUser(java.lang.String login,
java.lang.String password)
throws SurveySystemException,
SurveySecurityException
login - Login namepassword - User password
SurveySecurityException - Thrown if the login doesn't match with the user's login
name.
SurveySystemException - If an error occurs in the application
public static java.util.ArrayList getUserList(User user)
throws SurveySystemException
user - User object
SurveySystemException - If an error occurs in the application
public static void deleteFolderPermission(User user,
long userId,
long folderId,
int permissionType)
throws SurveySecurityException,
SurveySystemException
userId.
user - User with permission to administer other usersuserId - User who will be denied the folder permission.folderId - Folder idpermissionType - Permission type, one of the following types:
PERMISSION_ADMINPERMISSION_READPERMISSION_MODIFYPERMISSION_FOLDER_ADD_FOLDERPERMISSION_FOLDER_ADD_SURVEY
SurveySystemException - If an error occurs in the system
SurveySecurityException - Thrown if the user is not authorized to administer the
user.
public static void deleteSurveyPermission(User user,
long userId,
long surveyId,
int permissionType)
throws SurveySecurityException,
SurveySystemException
userId.
user - User with permission to administer other usersuserId - User who will be denied the survey permission.surveyId - Survey idpermissionType - Permission type, one of the following types:
PERMISSION_ADMINPERMISSION_READPERMISSION_MODIFYPERMISSION_SURVEY_CREATE_REPORTPERMISSION_SURVEY_DELETE_RESPONDENTPERMISSION_SURVEY_INVITATIONSurveySecurityException - Thrown if the user is not authorized to administer the
user.
SurveySystemException - If an error occurs in the system
public static void deleteAddQuestionLibraryPermission(User user,
long userId)
throws SurveySecurityException,
SurveySystemException
userId.
user - User with permission to administer other usersuserId - User who will be denied the permission to create question libraries
SurveySystemException - If an error occurs in the system
SurveySecurityException - Thrown if the user is not authorized to administer the
user.
public static void grandFolderPermission(User user,
long userId,
long folderId,
int permissionType)
throws SurveySecurityException,
SurveySystemException
user - User with permission to administer other usersuserId - User who will get the permission.folderId - Folder idpermissionType - Permission type, one of the following types:
PERMISSION_ADMINPERMISSION_READPERMISSION_MODIFYPERMISSION_FOLDER_ADD_FOLDERPERMISSION_FOLDER_ADD_SURVEY
SurveySecurityException - Thrown if the user is not authorized to administer the
user.
SurveySystemException - If an error occurs in the system
public static void grandSurveyPermission(User user,
long userId,
long surveyId,
int permissionType)
throws SurveySecurityException,
SurveySystemException
user - User with permission to administer other usersuserId - User who will get the permission.surveyId - Survey idpermissionType - Permission type, one of the following types:
PERMISSION_ADMIN PERMISSION_READPERMISSION_MODIFYPERMISSION_SURVEY_CREATE_REPORTPERMISSION_SURVEY_DELETE_RESPONDENTPERMISSION_SURVEY_INVITATIONSurveySecurityException - Thrown if the user is not authorized to administer the
user.
SurveySystemException - If an error occurs in the system
public static void grantUserGroupAdminPermission(User user,
long userId,
long userGroupId)
throws SurveySecurityException,
SurveySystemException
user - User with permission to administer other usersuserId - User who will get the permission.userGroupId - The user group the user will get permission to manage
SurveySecurityException - Thrown if the user is not authorized to administer the
user.
SurveySystemException - If an error occurs in the system
public static void grantAddQuestionLibraryPermission(User user,
long userId)
throws SurveySecurityException,
SurveySystemException
user - User with permission to administer other usersuserId - User who will get the permission.
SurveySecurityException - Thrown if the user is not authorized to administer the
user.
SurveySystemException - If an error occurs in the system
public static boolean hasFolderPermission(User user,
long userId,
long folderId,
int permissionType)
throws SurveySecurityException,
SurveySystemException
userId has the specified folder permission.
user - User with permission to administer other usersuserId - User to check permission.folderId - Folder idpermissionType - Permission type, one of the following types:
PERMISSION_ADMINPERMISSION_READPERMISSION_MODIFYPERMISSION_FOLDER_ADD_FOLDERPERMISSION_FOLDER_ADD_SURVEY
SurveySecurityException - Thrown if the user is not authorized to administer the
user.
SurveySystemException - If an error occurs in the system
public static boolean hasSurveyPermission(User user,
long userId,
long surveyId,
int permissionType)
throws SurveySecurityException,
SurveySystemException
userId has the specified survey permission.
user - User with permission to administer other usersuserId - User to check permission.surveyId - Survey idpermissionType - Permission type, one of the following types:
PERMISSION_ADMINPERMISSION_READPERMISSION_MODIFYPERMISSION_SURVEY_CREATE_REPORTPERMISSION_SURVEY_DELETE_RESPONDENTPERMISSION_SURVEY_INVITATIONSurveySecurityException - Thrown if the user is not authorized to administer the
user.
SurveySystemException - If an error occurs in the system
public static boolean isUniqueLogin(java.lang.String login)
throws SurveySystemException
login - Login name to check
SurveySystemException - If an error occurs in the system
public static void logOutUser(long userId)
throws SurveySystemException
uerId -
SurveySystemException
public static void updateUser(User userToUpdate)
throws SurveySystemException
userToUpdate - Description of the Parameter
SurveySystemException - If an error occurs in the application
public static void updateUserGroup(User user,
UserGroup userGroupToUpdate)
throws SurveySystemException,
SurveySecurityException
user - A user with permission to create user groupsuserGroupToUpdate - The user group to update
SurveySystemException - Thrown if the user has no permission to fulfill the operation
SurveySecurityException - If an error occurs in the application
public static void addGroupMember(User user,
long userGroupId,
long userId)
throws SurveySystemException,
SurveySecurityException
user - A user with permission manage the user group.userGroupId - User group iduserId - User id to add
SurveySystemException - Thrown if the user has no permission to fulfill the operation
SurveySecurityException - If an error occurs in the application
public static void deleteGroupMember(User user,
long userGroupId,
long userId)
throws SurveySystemException,
SurveySecurityException
user - A user with permission manage the user group.userGroupId - User group iduserId - User id to add
SurveySystemException - Thrown if the user has no permission to fulfill the operation
SurveySecurityException - If an error occurs in the application
public static boolean userExists(long userId)
throws SurveySystemException
userId - The user id
SurveySystemException - if any exception occurs.
|
Copyright ? ObjectPlanet Inc. All Rights Reserved. | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||