public class LoginUtilities extends Object
Constructor | Description |
---|---|
LoginUtilities() |
Modifier and Type | Method | Description |
---|---|---|
static Boolean |
allowSaveLogin(javax.servlet.http.HttpServletRequest request) |
|
static boolean |
canEditIssue(org.itracker.model.Issue issue) |
|
static boolean |
canEditIssue(org.itracker.model.Issue issue,
org.springframework.security.core.userdetails.UserDetails user) |
|
static boolean |
canViewIssue(org.itracker.model.Issue issue) |
Returns true if the user has permission to view the requested issue.
|
static boolean |
canViewIssue(org.itracker.model.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 org.itracker.model.User |
getCurrentUser(javax.servlet.http.HttpServletRequest request) |
Deprecated.
|
static org.itracker.services.authentication.ITrackerUserDetails |
getPrincipal() |
Utility for accessing the current logged in user's principal
|
static int |
getRequestAuthType(javax.servlet.http.HttpServletRequest request) |
|
static boolean |
hasAnyPermission(org.itracker.model.Project project,
org.itracker.model.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(org.itracker.model.PermissionType permissionNeeded) |
Returns true if the user has all the required permissions.
|
static boolean |
hasPermission(org.itracker.model.PermissionType[] permissionsNeeded,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
Deprecated.
|
static boolean |
hasPermission(org.itracker.model.PermissionType permissionNeeded,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
|
static boolean |
hasPermission(org.itracker.model.Project project,
org.itracker.model.PermissionType permissionNeeded) |
Returns true if the user has the required permission for the given project.
|
static boolean |
hasPermission(org.itracker.model.Project project,
org.itracker.model.PermissionType[] permissionsNeeded) |
Returns true if the user has all of required permissions for the project.
|
static org.itracker.model.User |
setupSession(String login,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
|
static org.itracker.model.User |
setupSession(org.itracker.model.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 org.itracker.model.User getCurrentUser(javax.servlet.http.HttpServletRequest request)
NullPointerException
- if the request was nullpublic static org.itracker.services.authentication.ITrackerUserDetails getPrincipal()
public static Boolean allowSaveLogin(javax.servlet.http.HttpServletRequest request)
public static org.itracker.model.User setupSession(String login, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public static org.itracker.model.User setupSession(org.itracker.model.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(org.itracker.model.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(org.itracker.model.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(org.itracker.model.Project project, org.itracker.model.PermissionType[] permissionsNeeded)
public static boolean hasPermission(org.itracker.model.Project project, org.itracker.model.PermissionType[] permissionsNeeded)
public static boolean hasPermission(org.itracker.model.PermissionType permissionNeeded)
permissionNeeded
- the permission to check forpublic static boolean hasPermission(org.itracker.model.Project project, org.itracker.model.PermissionType permissionNeeded)
project
- project to which permission is checked forpermissionNeeded
- the permission to check forpublic static boolean canViewIssue(org.itracker.model.Issue issue)
issue
- an IssueModel of the issue to check view permission forpublic static boolean canViewIssue(org.itracker.model.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(org.itracker.model.Issue issue)
public static boolean canEditIssue(org.itracker.model.Issue issue, org.springframework.security.core.userdetails.UserDetails user)
Copyright © 2002–2019 itracker. All rights reserved.