-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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 users with code unit access permission only can not access contributors page #32299
Closed
Closed
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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
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
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.
That's just questionable, why it needs to check this permission? Does the handler expose any "real code"?
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.
The original logic in the template needs code permission or it will display nothing.
So, I think it should have same permission checks in router, or when you removed them in the menu in UI, but you can still access these pages by just editing the URL.
And for the original logic, maybe it depends on the definition of
Code
: does author info include in it?These information come from commits, and commits are
Code
.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.
Actually I have no interest to touch the legacy logic at the moment because it is quite a mess (I did do some quick fixes just because these "bugs" affected end users and are potentially related to my PRs).
The real problem is that there is NO clear definition for the "permission" system, people just patched the code again and again, and there are more serious abuses like "issue reader / pull reader permissions are mixed (
/{type:issues|pulls}
)".Maybe you could define these permissions clearly first before code work. The definition should be reasonable to most end users and daily usage, but not by what it literally looks.
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.
IMO, anything contain the information from commits (no matter from original repo or forks) or themselves should be controlled by code unit permission, as codes are managed by git, and git uses commits to record the status/changes of these codes.
I'm not sure whether it is acceptable to others. What's your opinion?
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.
Why they need such strict rules?
Permissions should be as loose as possible to satisfy every users for various use cases, as long as the permission design doesn't cause harm or leak sensitive data.
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.
In my mind:
The purpose of a permission system is to "prevent from users doing harm to a repo".
code
permission means the user could access the full code. Disabling it means that prevent the user from accessing the full code. The purpose should be "protect the full code from leaking"pr read
means that the user could discuss and review the code change (not the full code) , approve or reject.activity
means that the user could see the statistics of the repo (commits number and authors do not really leak code)So, that's why I would like to keep the commit/files tabs on the "pr" page, and would like to make users could read the statistics of the repo as much as possible (useful and no harm)
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.
Give me some time to think about it.
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.
It is removed.