-
Notifications
You must be signed in to change notification settings - Fork 16
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
project(ui): confine users to projects and standardize slug usage #154
Merged
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
b53a9e9
project(user): assign users to projects
psyray 476f622
project(user): fix bad redir after project save
psyray 415bf8f
project(project): add description field
psyray 9adec03
dashboard(code): explicit define import
psyray 4fab4fd
project(acl): add permission checks for the current user
psyray db591cd
project(acl): prevent non-admin users to edit projects
psyray 3e830d6
project(user): assign users to projects
psyray 13b4a6a
project(user): fix bad redir after project save
psyray d802f69
project(project): add description field
psyray 10f86f1
dashboard(code): explicit define import
psyray 1428a24
project(acl): add permission checks for the current user
psyray 6ce133b
project(acl): prevent non-admin users to edit projects
psyray 420a084
Merge branch '71-confine-user-to-project' of github.com:Security-Tool…
psyray 1f25fba
Merge branch 'release/2.1.0' into 71-confine-user-to-project
psyray 2e3f3fa
Merge branch 'release/2.1.0' into 71-confine-user-to-project
psyray a3d3a66
feat(project): add a 404 page and redirect users to first project found
psyray 7242f87
Merge branch 'release/2.1.0' into 71-confine-user-to-project
psyray 7bb597d
refactor: remove user_has_project_access decorator and streamline pro…
psyray d282c31
refactor: update URL patterns and middleware for project context
psyray 8b0afc8
Merge branch 'release/2.1.0' into 71-confine-user-to-project
psyray 01b5862
refactor: convert indentation to tabs and add ProjectSerializer import
psyray dd32257
refactor(tests): remove redundant slug parameter from test cases
psyray 482b1f0
feat: enhance user management and refactor template tags
psyray 18096bf
refactor: streamline views and improve code readability
psyray 227ed95
fix: improve error handling and logging
psyray 81fb9c8
Merge branch 'release/2.1.0' into 71-confine-user-to-project
psyray 34072cb
fix: update user status change handling and improve test coverage
psyray dc9850e
Merge branch 'release/2.1.0' into 71-confine-user-to-project
psyray a94ca18
feat: add endpoint to set current project and update project selectio…
psyray 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
Prev
Previous commit
feat: add endpoint to set current project and update project selectio…
…n logic - Removed JavaScript function for setting the current project and its associated event listeners. - Added a new endpoint in the backend to handle setting the current project via a GET request. - Updated the project selection dropdown to use the new backend endpoint.
- Loading branch information
commit a94ca187e6589188e45309e3f18bb3fc32f11319
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -3282,14 +3282,3 @@ function handleHashInUrl(){ | |
} | ||
} | ||
} | ||
|
||
function setCurrentProject(projectId) { | ||
const secure = location.protocol === 'https:'; | ||
document.cookie = `currentProjectId=${projectId}; path=/; SameSite=Strict; ${secure ? 'Secure;' : ''} HttpOnly`; | ||
} | ||
|
||
document.querySelectorAll('.dropdown-item[data-project-id]').forEach(link => { | ||
link.addEventListener('click', function(e) { | ||
setCurrentProject(this.getAttribute('data-project-id')); | ||
}); | ||
}); |
This file contains 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 |
---|---|---|
|
@@ -30,7 +30,7 @@ <h5 class="text-overflow mb-2">Search History</h5> | |
</a> | ||
<div class="dropdown-menu"> | ||
{% for user_project in projects %} | ||
<a href="{% url 'dashboardIndex' user_project.slug %}" class="dropdown-item {% if user_project == current_project %} active {% endif %}" data-project-id="{{ user_project.id }}"> | ||
<a href="{% url 'set_current_project' user_project.slug %}" class="dropdown-item {% if user_project == current_project %} active {% endif %}"> | ||
<span>{{user_project.name}}</span> | ||
</a> | ||
{% endfor %} | ||
|
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.
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Copilot Autofix AI 4 months ago
To fix the problem, we need to ensure that detailed error information is logged on the server while a generic error message is returned to the user. This can be achieved by modifying the exception handling code to log the detailed error and return a generic message.
handle_update_user
andhandle_create_user
functions to log the detailed error message and return a generic error message to the user.