Package net.bjmsw.hda.vs.helper
Class AuthHelper
java.lang.Object
net.bjmsw.hda.vs.helper.AuthHelper
The AuthHelper class provides methods for handling user authentication and authorization.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckAuth(Request r, Benutzer.USER_TYPE type) Checks if the user in the request is authorized with the specified user type.static BenutzerRetrieves the logged-in Benutzer (user) based on the authorization token in the request's header.
-
Constructor Details
-
AuthHelper
public AuthHelper()
-
-
Method Details
-
checkLogin
Retrieves the logged-in Benutzer (user) based on the authorization token in the request's header.- Parameters:
r- Request object containing the authorization token in the headers- Returns:
- The logged-in Benutzer corresponding to the authorization token, or null if not found
-
checkAuth
Checks if the user in the request is authorized with the specified user type.- Parameters:
r- Request object containing the authorization token in the headerstype- The user type to check authorization against- Returns:
- True if the user in the request is authorized with the specified user type, otherwise false
-