org.itracker.core.AuthenticationConstants
public class UserUtilities extends Object implements org.itracker.core.AuthenticationConstants
Modifier and Type | Field | Description |
---|---|---|
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 |
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 | Description |
---|---|
UserUtilities() |
Modifier and Type | Method | Description |
---|---|---|
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 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 List<NameValuePair> |
getPermissionTypeNames(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) |
Deprecated.
|
static boolean |
hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
Integer projectId,
int permissionNeeded) |
Deprecated.
|
static boolean |
hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
Integer projectId,
PermissionType permissionNeeded) |
Returns true if the user has the required permission for the given project.
|
static boolean |
hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
Integer projectId,
PermissionType[] permissionsNeeded) |
Returns true if the user has any of required permissions for the given project.
|
static boolean |
hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
PermissionType permissionNeeded) |
Deprecated.
|
static boolean |
hasPermission(Map<Integer,Set<PermissionType>> permissionsMap,
PermissionType[] permissionsNeeded) |
Deprecated.
|
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) |
Deprecated.
|
static Map<Integer,Set<PermissionType>> |
mapPermissionTypesByProjectId(List<Permission> permissionsList) |
Maps sets of permission types by project ID.
|
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 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
public static String getStatusName(int value)
public static String getPermissionName(int value)
public static List<NameValuePair> getPermissionNames()
public static List<NameValuePair> getPermissionNames(Locale locale)
public static List<NameValuePair> getPermissionTypeNames(Locale locale)
public static String generatePassword() throws org.itracker.PasswordException
org.itracker.PasswordException
public static String encryptPassword(String password) throws org.itracker.PasswordException
password
- the plain text password to encrypt.org.itracker.PasswordException
@Deprecated public static boolean isSuperUser(Map<Integer,Set<PermissionType>> permissionsMap)
permissionsMap
- map of user permissions by project Id@Deprecated public static boolean hasPermission(Map<Integer,Set<PermissionType>> permissionsMap, int permissionNeeded)
@Deprecated public static boolean hasPermission(Map<Integer,Set<PermissionType>> permissionsMap, PermissionType permissionNeeded)
permissionsMap
- a Map of the user's permissions by project IDpermissionNeeded
- the permission to check for@Deprecated public static boolean hasPermission(Map<Integer,Set<PermissionType>> permissionsMap, PermissionType[] permissionsNeeded)
permissionsMap
- a HashMap of the user's permissionspermissionsNeeded
- a list of permissions that can fulfill the permission check@Deprecated public static boolean hasPermission(Map<Integer,Set<PermissionType>> permissionsMap, Integer projectId, int permissionNeeded)
public static boolean hasPermission(Map<Integer,Set<PermissionType>> permissionsMap, Integer projectId, PermissionType permissionNeeded)
permissionsMap
- a HashMap of the user's permissionsprojectId
- the project that the permission is required forpermissionNeeded
- the permission to check forpublic static boolean hasPermission(Map<Integer,Set<PermissionType>> permissionsMap, Integer projectId, PermissionType[] permissionsNeeded)
permissionsMap
- 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 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 hiddensections
- an integer of all sections the user is hidingpublic static Integer[] getHiddenIndexSections(int sections)
Copyright © 2002–2019 itracker. All rights reserved.