|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.itracker.services.util.UserUtilities
public class UserUtilities
| Field Summary | |
|---|---|
static Set<Integer> |
ALL_PERMISSIONS_SET
|
protected static char[] |
alphabet
|
static int |
PERMISSION_ASSIGN_OTHERS
Issue Assign to Others Permissions. |
static int |
PERMISSION_ASSIGN_SELF
Issue Assign to Self Permission. |
static int |
PERMISSION_ASSIGNABLE
Issue Assignable. |
static int |
PERMISSION_CLOSE
Issue Close Permission. |
static int |
PERMISSION_CREATE
Issue Create Permission |
static int |
PERMISSION_CREATE_OTHERS
Create for Others. |
static int |
PERMISSION_EDIT
Issue Edit Permission. |
static int |
PERMISSION_EDIT_FULL
Full edit permission. |
static int |
PERMISSION_EDIT_USERS
Edit Users Issues Permission. |
static int |
PERMISSION_PRODUCT_ADMIN
Product Admin Permission |
static int |
PERMISSION_UNASSIGN_SELF
Issue Unassign Self Permission. |
static int |
PERMISSION_USER_ADMIN
User Admin Permission. |
static int |
PERMISSION_VIEW_ALL
View All Issues Permission. |
static int |
PERMISSION_VIEW_USERS
View Users Issues Permission. |
static int |
PREF_HIDE_ASSIGNED
|
static int |
PREF_HIDE_CREATED
|
static int |
PREF_HIDE_UNASSIGNED
|
static int |
PREF_HIDE_WATCHED
|
static int |
REGISTRATION_TYPE_ADMIN
|
static int |
REGISTRATION_TYPE_IMPORT
|
static int |
REGISTRATION_TYPE_SELF
|
static int |
STATUS_ACTIVE
|
static int |
STATUS_DELETED
|
static int |
STATUS_LOCKED
|
| Fields inherited from interface org.itracker.services.util.AuthenticationConstants |
|---|
AUTH_TYPE_CERTIFICATE, AUTH_TYPE_PASSWORD_ENC, AUTH_TYPE_PASSWORD_PLAIN, AUTH_TYPE_REQUEST, AUTH_TYPE_SHARED_SECRET, AUTH_TYPE_UNKNOWN, REQ_SOURCE_API, REQ_SOURCE_UNKNOWN, REQ_SOURCE_WEB, UPDATE_TYPE_CORE, UPDATE_TYPE_PERMISSION_ADD, UPDATE_TYPE_PERMISSION_SET, UPDATE_TYPE_PREFERENCE |
| Constructor Summary | |
|---|---|
UserUtilities()
|
|
| Method Summary | |
|---|---|
static Permission[] |
createPermissionArray(User user,
Project project,
int[] permissions)
|
static String |
encryptPassword(String password)
Returns an encrypted (digest) password from a plain text password. |
static String |
generatePassword()
Genrates a new random password. |
static List<NameValuePair> |
getAssignableIssueOwnersList(Issue issue,
Project project,
User currUser,
Locale locale,
UserService userService,
Map<Integer,Set<PermissionType>> userPermissions)
This method will obtain and build a list of possible owners for the webpages to display and the operator to choose from. |
static Integer[] |
getHiddenIndexSections(int sections)
|
static String |
getInitial(String name)
|
static String |
getPermissionName(int value)
|
static String |
getPermissionName(int value,
Locale locale)
|
static List<NameValuePair> |
getPermissionNames()
|
static List<NameValuePair> |
getPermissionNames(Locale locale)
|
static String |
getStatusName(int value)
|
static String |
getStatusName(int value,
Locale locale)
|
static HashMap<String,String> |
getStatusNames()
|
static HashMap<String,String> |
getStatusNames(Locale locale)
|
static boolean |
hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
int permissionNeeded)
Returns true if the user has the required permission in any project. |
static boolean |
hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
int[] permissionsNeeded)
Returns true if the user has any of required permissions in any project. |
static boolean |
hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
Integer projectId,
int permissionNeeded)
Returns true if the user has the required permission for the given project. |
static boolean |
hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
Integer projectId,
int[] permissionsNeeded)
Returns true if the user has any of required permissions for the given project. |
static boolean |
hideIndexSection(int section,
int sections)
Returns whether the user is currently hiding a particular section on the myItracker page. |
static boolean |
isSuperUser(Map<Integer,Set<PermissionType>> permissionsMap)
Checks to see if the user is a super user. |
static Map<Integer,Set<PermissionType>> |
mapPermissionTypesByProjectId(List<Permission> permissionsList)
Maps sets of permission types by project ID. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final char[] alphabet
public static final int STATUS_DELETED
public static final int STATUS_ACTIVE
public static final int STATUS_LOCKED
public static final int PERMISSION_USER_ADMIN
public static final int PERMISSION_PRODUCT_ADMIN
public static final int PERMISSION_CREATE
public static final int PERMISSION_EDIT
public static final int PERMISSION_CLOSE
public static final int PERMISSION_ASSIGN_SELF
public static final int PERMISSION_ASSIGN_OTHERS
public static final int PERMISSION_VIEW_ALL
public static final int PERMISSION_VIEW_USERS
public static final int PERMISSION_EDIT_USERS
public static final int PERMISSION_UNASSIGN_SELF
public static final int PERMISSION_ASSIGNABLE
public static final int PERMISSION_CREATE_OTHERS
public static final int PERMISSION_EDIT_FULL
public static final Set<Integer> ALL_PERMISSIONS_SET
public static final int REGISTRATION_TYPE_ADMIN
public static final int REGISTRATION_TYPE_SELF
public static final int REGISTRATION_TYPE_IMPORT
public static final int PREF_HIDE_ASSIGNED
public static final int PREF_HIDE_UNASSIGNED
public static final int PREF_HIDE_CREATED
public static final int PREF_HIDE_WATCHED
| Constructor Detail |
|---|
public UserUtilities()
| Method Detail |
|---|
public static String getStatusName(int value)
public static String getStatusName(int value,
Locale locale)
public static HashMap<String,String> getStatusNames()
public static HashMap<String,String> getStatusNames(Locale locale)
public static String getPermissionName(int value)
public static String getPermissionName(int value,
Locale locale)
public static List<NameValuePair> getPermissionNames()
public static List<NameValuePair> getPermissionNames(Locale locale)
public static String generatePassword()
throws PasswordException
PasswordException
public static String encryptPassword(String password)
throws PasswordException
password - the plain text password to encrypt.
PasswordExceptionpublic static boolean isSuperUser(Map<Integer,Set<PermissionType>> permissionsMap)
permissions - map of user permissions by project Id
public static boolean hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
int permissionNeeded)
permissions - a Map of the user's permissions by project IDpermissionNeeded - the permission to check for
public static boolean hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
int[] permissionsNeeded)
permissions - a HashMap of the user's permissionspermissionsNeeded - a list of permissions that can fulfill the permission check
public static boolean hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
Integer projectId,
int permissionNeeded)
permissions - a HashMap of the user's permissionsprojectId - the project that the permission is required forpermissionNeeded - the permission to check for
public static boolean hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
Integer projectId,
int[] permissionsNeeded)
permissions - a HashMap of the user's permissionsprojectId - the project that the permission is required forpermissionsNeeded - a list of permissions that can fulfill the permission checkpublic static String getInitial(String name)
public static Permission[] createPermissionArray(User user,
Project project,
int[] permissions)
public static Map<Integer,Set<PermissionType>> mapPermissionTypesByProjectId(List<Permission> permissionsList)
public static boolean hideIndexSection(int section,
int sections)
section - the section to check if it is hiddenan - integer of all sections the user is hiding
public static Integer[] getHiddenIndexSections(int sections)
public static List<NameValuePair> getAssignableIssueOwnersList(Issue issue,
Project project,
User currUser,
Locale locale,
UserService userService,
Map<Integer,Set<PermissionType>> userPermissions)
issue - project - currUser - locale - userPermissions -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||