-
Notifications
You must be signed in to change notification settings - Fork 12
in data store the create page the upload doc fixed #22
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
Open
cherry-git999
wants to merge
8
commits into
Agriworks:main
Choose a base branch
from
cherry-git999:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
aa18db8
data store create page upload file working now
cherry-git999 67ce56e
fixed view file issue also
cherry-git999 614c1fa
refactor(file-upload): use hey-api SDK for presigned upload and viewing
cherry-git999 75a92bf
fix(download): resolve 404 error and enable direct blob downloads
cherry-git999 0d2388c
feat(sync): Phase 1 & 2 - Connect updated ERPNext client & build gene…
cherry-git999 fb5da0e
feat(mapping): Phase 3 - Generic dashboard-specific ERP data mapping …
cherry-git999 35942e1
feat(dashboards): Phase 4 - Migrate all 6 Streamlit dashboards to Mon…
cherry-git999 29e917c
feat(warehouse): Phase 5 - Warehouse refresh & reopen auto-sync with …
cherry-git999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,13 +95,27 @@ def check_user_role_access(request: RoleCheckRequest, fastapi_request: Request, | |
| raise HTTPException(status_code=404, detail="User not found") | ||
|
|
||
| # Get user's role | ||
| role_id = user.get("role_id") | ||
| role_ids = user.get("role_id") | ||
| role_name = "user" | ||
| if role_id: | ||
| role = get_role_by_id(role_id) | ||
| if role and role.get("role_name"): | ||
| role_name = role["role_name"] | ||
| logger.debug("User role resolved: role_id=%s role_name=%s", role_id, role_name) | ||
| if role_ids: | ||
| # Handle both list of IDs and single ID cases | ||
| if not isinstance(role_ids, list): | ||
| role_ids = [role_ids] | ||
|
|
||
| roles_found = [] | ||
| for r_id in role_ids: | ||
| role = get_role_by_id(r_id) | ||
| if role and role.get("role_name"): | ||
| roles_found.append(role["role_name"]) | ||
|
|
||
| # Select the most privileged role if multiple exist | ||
| if "superadmin" in roles_found: | ||
| role_name = "superadmin" | ||
| elif "admin" in roles_found: | ||
| role_name = "admin" | ||
| elif roles_found: | ||
| role_name = roles_found[0] | ||
| logger.debug("User role resolved: role_ids=%s role_name=%s", role_ids, role_name) | ||
|
Contributor
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. This is generally problematic so we need to have an rbac code that will be used to centralize all the role checking under that. Even admins and superadmins need to have some kind of a flow |
||
|
|
||
| # Find matching endpoint access rule | ||
| endpoint_access = find_matching_endpoint_access(role_name, request.path) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
if its plural ids being stored / retrieved, then I'd like to know. like the property should be
role_idsthen