-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EPMRPP-97027 user avatar #2111
EPMRPP-97027 user avatar #2111
Changes from all commits
8aa6257
e8d1c6f
23c7e6a
6247e80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
+1 −0 | api/openapi/apis/users.yaml | |
+1 −0 | api/openapi/reportportal-api.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.epam.ta.reportportal.auth.permissions; | ||
|
||
import org.springframework.security.core.Authentication; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component("authenticatedUserPermission") | ||
@LookupPermission({"authenticated"}) | ||
public class Authenticated implements Permission { | ||
|
||
@Override | ||
public boolean isAllowed(Authentication authentication, Object invitationRequest) { | ||
return authentication.isAuthenticated(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,8 @@ private Permissions() { | |
public static final String ALLOWED_TO_VIEW_PROJECT = | ||
"hasPermission(#projectKey.toLowerCase(), 'allowedToViewProject')" + "||" + IS_ADMIN; | ||
|
||
public static final String AUTHENTICATED = IS_ADMIN + "||" + "hasPermission(#userId, 'authenticated')"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
public static final String INVITATION_ALLOWED = IS_ADMIN + "||" | ||
+ "hasPermission(#invitationRequest, 'invitationAllowed')"; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,15 @@ public interface GetFileHandler { | |
*/ | ||
BinaryData getUserPhoto(ReportPortalUser loggedInUser, boolean loadThumbnail); | ||
|
||
/** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
* Returns {@link InputStream} for current logged-in user photo. | ||
* | ||
* @param userId requested user Id {@link Long} | ||
* @param loadThumbnail true if needed to load thumbnail | ||
* @return {@link BinaryData} | ||
*/ | ||
BinaryData getUserPhoto(Long userId, boolean loadThumbnail); | ||
|
||
/** | ||
* Returns {@link InputStream} for photo of the {@link com.epam.ta.reportportal.entity.user.User} | ||
* with specified username | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a Javadoc comment.