-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Question: expected results of models.GetRepositoryAccesses()? #10068
Comments
I think maybe the function I think we should refactor all |
It's an old broken function that I wanted to remove when I fixed search repositories but realised I couldn't as it is part of the API. It should be deprecated. |
Thanks! So, what's the API expected to do (with some detail)? Maybe it's easier for me to rewrite the endpoint rather than it parts? Where is it used? |
Ah I see. I think it literally listed if a user was a collaborator or not. |
Thanks! So it deals with explicit accesses. 👍 |
master
)While working on #9787, I need to rewrite
models.GetRepositoryAccesses()
. This function is only used byListMyRepos()
as a complement ofGetUserRepositories()
.ListMyRepos()
works the API function:GetRepositoryAccesses()
is supposed to return all the repositories that the user has access to but does not own. The problem is that the unit test goes like:gitea/models/access_test.go
Lines 90 to 96 in 04cbdf5
With the current data, this function should fail because
user1
is a site administrator, so it's got access to all repositories. The test asserts that the function returns zero results.My question is: is the unit test/fixture set wrong, or is it that the function is expected to ignore the
is_admin
flag to return a shorter list?The text was updated successfully, but these errors were encountered: