Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class UserAttributeFactory {
public static final String KEY_USER_ROLE = "user_role";

public static final String DOCUMENT_UPLOAD_PERMISSION = "document:upload";
public static final String DOCUMENT_DOWNLOAD_PERMISSION = "document:download";
public static final String DOCUMENT_FETCH_PERMISSION = "document:view";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Clarify the semantic difference between download and view permissions to avoid future misuse.

Since DOCUMENT_FETCH_PERMISSION maps to "document:view", the name may imply a more generic operation than intended. If view and download are distinct capabilities, consider renaming the constant to match the permission string (e.g., DOCUMENT_VIEW_PERMISSION) or adjusting the permission string to match the name, to keep permission checks unambiguous across the codebase.

Suggested implementation:

    public static final String DOCUMENT_UPLOAD_PERMISSION = "document:upload";
    public static final String DOCUMENT_DOWNLOAD_PERMISSION = "document:download";
    public static final String DOCUMENT_VIEW_PERMISSION = "document:view";
    private void getAttributesForLoanOfficer(Map<String, Object> attributes) {
        attributes.put(DOCUMENT_UPLOAD_PERMISSION, true);
        attributes.put(DOCUMENT_DOWNLOAD_PERMISSION, true);
        attributes.put(DOCUMENT_VIEW_PERMISSION, true);
    }
  1. Search the entire codebase for usages of DOCUMENT_FETCH_PERMISSION and update them to DOCUMENT_VIEW_PERMISSION.
  2. If any configuration, documentation, or tests reference DOCUMENT_FETCH_PERMISSION, update them as well to keep naming consistent and avoid confusion between view and download capabilities.


public Map<String, Object> buildRegistrationAttributes(UserRegistrationDto registrationData) {
Map<String, Object> attributes = new HashMap<>();
Expand All @@ -30,6 +32,8 @@ public Map<String, Object> buildRegistrationAttributes(UserRegistrationDto regis

private void getAttributesForLoanOfficer(Map<String, Object> attributes) {
attributes.put(DOCUMENT_UPLOAD_PERMISSION, true);
attributes.put(DOCUMENT_DOWNLOAD_PERMISSION, true);
attributes.put(DOCUMENT_FETCH_PERMISSION, true);
}


Expand Down
Loading