-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Multiple permissions fixes for projects #12547
Multiple permissions fixes for projects #12547
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12547 +/- ##
==========================================
- Coverage 43.45% 43.44% -0.02%
==========================================
Files 643 643
Lines 71144 71155 +11
==========================================
- Hits 30919 30912 -7
- Misses 35218 35233 +15
- Partials 5007 5010 +3
Continue to review full report at Codecov.
|
c845258
to
2d9d97f
Compare
* there is no reason to show the button for users that are not signed in
as per lafriks' suggestion in the comment
2d9d97f
to
3e05f11
Compare
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.
This is not the correct test - we should only show the button if the user can create project boards
This should now be addressed by the latest changes. |
|
* CanWriteIssues and CanWritePulls implies (and requires) signed in user
This kind of screams for a |
Yeah, a similar thought also appeared in the discord. I am not sure how to do that, though. :( |
adding new ctx variable is an option: gitea/routers/repo/projects.go Line 292 in 4027c5d
|
Ideally it would be a utility function somewhere in the project-related files which is then called to set the template variable on pages that render that template. That way, it can be re-used everywhere. |
I may try to hack something together 🚀 |
I think we have a new unit named Project. Then those who have write permission of unit Project could edit and delete the board. |
…-users_button-new-project-board
Signed-off-by: Andrew Thornton <art27@cantab.net>
I've taken the liberty to do the fixes. |
From what I can gather it looks great, thank you! |
Cheers folks! 🚀 🚀 🚀 |
As communicated in
![before](https://user-images.githubusercontent.com/61180606/90804795-007c7500-e31b-11ea-9f86-487ad66cfa49.png)
![after](https://user-images.githubusercontent.com/61180606/90804808-04a89280-e31b-11ea-8188-80e643584f41.png)
discord/develop
, here's this little PR.I believe there is no reason to show the 'New Project board' button for users that are not signed in.
Before:
After: