Skip to content
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

fix: project routes and permissions in portal #36218

Merged

Conversation

GursheenK
Copy link
Member

Problem

  • Projects link in the sidebar of the Web Portal routes incorrectly.
  • Opening the Project list throws a Permission Error.
  • Projects for all Customers are shown irrespective of the current user.

Solution

  • Added the has_website_permission for Project Doctype in hooks.py.
  • Made the Sidebar Item Projects specific for Customer Role users.
  • Added logic to filter projects for which the current user has access while generating the Project list.

Example
Create a Customer.
Create a Website User and add the User to the Customer's Portal Users table.
Create a Project with the above Customer.
Add the above Website User in the list of Project Users in the Project.
Login using the user to view the project details.

Screenshots

Screenshot 2023-07-20 at 6 46 03 PM Screenshot 2023-07-20 at 6 46 32 PM Screenshot 2023-07-20 at 6 47 05 PM Screenshot 2023-07-20 at 6 47 17 PM

Closes #34706

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Jul 20, 2023
@stale
Copy link

stale bot commented Aug 5, 2023

This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.

@stale stale bot added the inactive label Aug 5, 2023
@stale stale bot closed this Aug 8, 2023
@stale stale bot removed the inactive label Aug 14, 2023
@deepeshgarg007 deepeshgarg007 marked this pull request as ready for review August 14, 2023 12:43
@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

Merging #36218 (6a7b45f) into develop (ce81ffd) will decrease coverage by 0.46%.
Report is 18 commits behind head on develop.
The diff coverage is 13.33%.

❗ Current head 6a7b45f differs from pull request most recent head 5c48074. Consider uploading reports for the commit 5c48074 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #36218      +/-   ##
===========================================
- Coverage    65.27%   64.81%   -0.46%     
===========================================
  Files          794      792       -2     
  Lines        62105    61829     -276     
===========================================
- Hits         40536    40076     -460     
- Misses       21569    21753     +184     
Files Changed Coverage Δ
erpnext/hooks.py 100.00% <ø> (ø)
erpnext/projects/doctype/project/project.py 50.15% <13.33%> (-1.31%) ⬇️

... and 36 files with indirect coverage changes

@deepeshgarg007 deepeshgarg007 merged commit 57538bd into frappe:develop Aug 25, 2023
10 of 11 checks passed
@jsbrain
Copy link

jsbrain commented Jan 9, 2024

This is still not working on latest v14 tags ... When adding a user to Projects > Users table nothing happens and the user still has not access to the project.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
do not backport needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customer can't see Project in Portal
4 participants