public class LoginUtilities extends Object
Constructor | Description |
---|---|
LoginUtilities() |
Modifier and Type | Method | Description |
---|---|---|
static Boolean |
allowSaveLogin(javax.servlet.http.HttpServletRequest request) |
|
static boolean |
canEditIssue(Issue issue) |
|
static boolean |
canEditIssue(Issue issue,
org.springframework.security.core.userdetails.UserDetails user) |
|
static boolean |
canViewIssue(Issue issue) |
Returns true if the user has permission to view the requested issue.
|
static boolean |
canViewIssue(Issue issue,
org.springframework.security.core.userdetails.UserDetails user) |
Returns true if the user has permission to view the requested issue.
|
static boolean |
checkAutoLogin(javax.servlet.http.HttpServletRequest request,
boolean allowSaveLogin) |
|
static int |
getConfiguredSessionTimeout() |
|
static Locale |
getCurrentLocale(javax.servlet.http.HttpServletRequest request) |
Get a locale from request
|
static User |
getCurrentUser(javax.servlet.http.HttpServletRequest request) |
Deprecated.
|
static ITrackerUserDetails |
getPrincipal() |
Utility for accessing the current logged in user's principal
|
static int |
getRequestAuthType(javax.servlet.http.HttpServletRequest request) |
|
static boolean |
hasAnyPermission(Project project,
PermissionType[] permissionsNeeded) |
Returns true if the user has any of required permissions for the project.
|
static boolean |
hasPermission(int permissionNeeded,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
Deprecated.
|
static boolean |
hasPermission(PermissionType permissionNeeded) |
Returns true if the user has all the required permissions.
|
static boolean |
hasPermission(PermissionType[] permissionsNeeded,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
Deprecated.
|
static boolean |
hasPermission(PermissionType permissionNeeded,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
|
static boolean |
hasPermission(Project project,
PermissionType permissionNeeded) |
Returns true if the user has the required permission for the given project.
|
static boolean |
hasPermission(Project project,
PermissionType[] permissionsNeeded) |
Returns true if the user has all of required permissions for the project.
|
static User |
setupSession(String login,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
|
static User |
setupSession(User user,
String encPassword,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
public static boolean checkAutoLogin(javax.servlet.http.HttpServletRequest request, boolean allowSaveLogin)
public static int getRequestAuthType(javax.servlet.http.HttpServletRequest request)
public static Locale getCurrentLocale(javax.servlet.http.HttpServletRequest request)
TODO the order of retrieving locale from request should be:
Constants.LOCALE_KEY
@Deprecated public static User getCurrentUser(javax.servlet.http.HttpServletRequest request)
NullPointerException
- if the request was nullpublic static ITrackerUserDetails getPrincipal()
public static Boolean allowSaveLogin(javax.servlet.http.HttpServletRequest request)
public static User setupSession(String login, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public static User setupSession(User user, String encPassword, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public static int getConfiguredSessionTimeout()
@Deprecated public static boolean hasPermission(int permissionNeeded, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
public static boolean hasPermission(PermissionType permissionNeeded, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
@Deprecated public static boolean hasPermission(PermissionType[] permissionsNeeded, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
public static boolean hasAnyPermission(Project project, PermissionType[] permissionsNeeded)
public static boolean hasPermission(Project project, PermissionType[] permissionsNeeded)
public static boolean hasPermission(PermissionType permissionNeeded)
permissionNeeded
- the permission to check forpublic static boolean hasPermission(Project project, PermissionType permissionNeeded)
project
- project to which permission is checked forpermissionNeeded
- the permission to check forpublic static boolean canViewIssue(Issue issue)
issue
- an IssueModel of the issue to check view permission forpublic static boolean canViewIssue(Issue issue, org.springframework.security.core.userdetails.UserDetails user)
issue
- an IssueModel of the issue to check view permission foruser
- the user principal of the user to check permission forpublic static boolean canEditIssue(Issue issue)
public static boolean canEditIssue(Issue issue, org.springframework.security.core.userdetails.UserDetails user)
Copyright © 2002–2019 itracker. All rights reserved.