Codeberg/Community
54
325
Fork
You've already forked Community
12

Assigning issued to no -organisation members #935

Open
opened 2023年02月12日 15:13:57 +01:00 by cutestnekoaqua · 10 comments

Hi, we at Calckey tried assigning idsues to users who wanna work on stuff but arent part of our organisation, but that wasnt possible. Can this be fixed? I am sure that worked on github

Hi, we at Calckey tried assigning idsues to users who wanna work on stuff but arent part of our organisation, but that wasnt possible. Can this be fixed? I am sure that worked on github
Owner
Copy link

Maybe propose org + repo members in the assignee dropdown as well as people who have participated in the issue discussion? And additionally allow entering every username by hand?

Maybe propose org + repo members in the assignee dropdown as well as people who have participated in the issue discussion? And additionally allow entering every username by hand?

Hi,
I'd like to work on this.
Can someone assign it to me?

Hi, I'd like to work on this. Can someone assign it to me?
Owner
Copy link

Yeah sure - as soon as the feature is implemented, I'll be able to assign you 😉

Yeah sure - as soon as the feature is implemented, I'll be able to assign you 😉

😄

😄

Hi,

I am adding to the dropdown any user that have interacted with the specific issue (comments, pull request etc..).

Now, some of these users have absolutely no access rights to the repo.
If one of these extra users is assigned to the issue, it fails the validation, quite rightly so, here:

2024年02月01日 07:33:13 ...rs/web/repo/issue.go:2387:UpdateIssueAssignee() [E] canBeAssigned: user doesn't have access to repo [user_id: 3, repo_name: DevWork]

This checks that the user in question has write permission to the repo for Code, issue or Pull Request .

The question I have about this:

What does being assigned to an issue mean?

1 - Does it simply mean that the user getting assigned gets is name displayed as an assignee on the issue?
2 - Or does it mean that the user getting assigned gets automatically granted some kind of write access to the repo?

Option 2 is dangerous as it would bypass a lot the access setup by the repo owner.
Option 1, It think means amending the 'CanBeAssigned' , extending the meaning to also include users that have posted to the issue in some way:

// CanBeAssigned return true if user can be assigned to issue or pull requests in repo
// Currently any write access (code, issues or pr's) is assignable, to match assignee list in user interface.
// FIXME: user could send PullRequest also could be assigned???
func CanBeAssigned(ctx context.Context, user *user_model.User, repo *repo_model.Repository, _ bool) (bool, error) {
 if user.IsOrganization() {
 return false, fmt.Errorf("Organization can't be added as assignee [user_id: %d, repo_id: %d]", user.ID, repo.ID)
 }
 perm, err := GetUserRepoPermission(ctx, repo, user)
 if err != nil {
 return false, err
 }
 return perm.CanAccessAny(perm_model.AccessModeWrite, unit.TypeCode, unit.TypeIssues, unit.TypePullRequests), nil
}
Hi, I am adding to the dropdown any user that have interacted with the specific issue (comments, pull request etc..). Now, some of these users have absolutely no access rights to the repo. If one of these extra users is assigned to the issue, it fails the validation, quite rightly so, here: ``` 2024年02月01日 07:33:13 ...rs/web/repo/issue.go:2387:UpdateIssueAssignee() [E] canBeAssigned: user doesn't have access to repo [user_id: 3, repo_name: DevWork] ``` This checks that the user in question has write permission to the repo for Code, issue or Pull Request . The question I have about this: What does being assigned to an issue mean? 1 - Does it simply mean that the user getting assigned gets is name displayed as an assignee on the issue? 2 - Or does it mean that the user getting assigned gets automatically granted some kind of write access to the repo? Option 2 is dangerous as it would bypass a lot the access setup by the repo owner. Option 1, It think means amending the 'CanBeAssigned' , extending the meaning to also include users that have posted to the issue in some way: ``` // CanBeAssigned return true if user can be assigned to issue or pull requests in repo // Currently any write access (code, issues or pr's) is assignable, to match assignee list in user interface. // FIXME: user could send PullRequest also could be assigned??? func CanBeAssigned(ctx context.Context, user *user_model.User, repo *repo_model.Repository, _ bool) (bool, error) { if user.IsOrganization() { return false, fmt.Errorf("Organization can't be added as assignee [user_id: %d, repo_id: %d]", user.ID, repo.ID) } perm, err := GetUserRepoPermission(ctx, repo, user) if err != nil { return false, err } return perm.CanAccessAny(perm_model.AccessModeWrite, unit.TypeCode, unit.TypeIssues, unit.TypePullRequests), nil } ```

What does being assigned to an issue mean?

1 - Does it simply mean that the user getting assigned gets is name displayed as an assignee on the issue?
2 - Or does it mean that the user getting assigned gets automatically granted some kind of write access to the repo?

It's an organizational thing. So it would only mean the user gets their name displayed as assignee, no extra rights are given to assignees.

Option 1, It think means amending the 'CanBeAssigned' , extending the meaning to also include users that have posted to the issue in some way:

That would be a fine approach.

> What does being assigned to an issue mean? > > 1 - Does it simply mean that the user getting assigned gets is name displayed as an assignee on the issue? > 2 - Or does it mean that the user getting assigned gets automatically granted some kind of write access to the repo? It's an organizational thing. So it would only mean the user gets their name displayed as assignee, no extra rights are given to assignees. > Option 1, It think means amending the 'CanBeAssigned' , extending the meaning to also include users that have posted to the issue in some way: That would be a fine approach.

Cheers.

Cheers.

PR #2283 is wrong. Way too many commits. There should only be one.

PR #2283 is wrong. Way too many commits. There should only be one.
Owner
Copy link

You'll need to rebase the branch regularly according to the current Forgejo workflow (which is likely subject to change).

You'll need two Git remotes configured for your local repo: Your fork and the Forgejo source. Then git fetch upstream (the Forgejo repo), and git rebase -i upstream/forgejo. This opens an interactive file where you replace "pick" with "drop" for all commits but those that are relevant for you. You can also see if it works without -i, but I doubt it.
In the end, you need to git push --force to your fork to update the PR.

Feel free to ask in the development matrix room if you need assistance. It's easy to get lost in all the commits :)

You'll need to rebase the branch regularly according to the current Forgejo workflow (which is [likely subject to change](https://codeberg.org/forgejo/discussions/issues/96)). You'll need two Git remotes configured for your local repo: Your fork and the Forgejo source. Then `git fetch upstream` (the Forgejo repo), and `git rebase -i upstream/forgejo`. This opens an interactive file where you replace "pick" with "drop" for all commits but those that are relevant for you. You can also see if it works without `-i`, but I doubt it. In the end, you need to `git push --force` to your fork to update the PR. Feel free to ask in the development matrix room if you need assistance. It's easy to get lost in all the commits :)

There is a draft PR at forgejo/forgejo#2283 which will be closed until @axd99 has time to work on it. It can be re-opened at any time.

There is a draft PR at https://codeberg.org/forgejo/forgejo/pulls/2283 which will be closed until @axd99 has time to work on it. It can be re-opened at any time.
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
accessibility

Reduces accessibility and is thus a "bug" for certain user groups on Codeberg.
bug

Something is not working the way it should. Does not concern outages.
bug
infrastructure

Errors evidently caused by infrastructure malfunctions or outages
Codeberg

This issue involves Codeberg's downstream modifications and settings and/or Codeberg's structures.
contributions welcome

Please join the discussion and consider contributing a PR!
docs

No bug, but an improvement to the docs or UI description will help
duplicate

This issue or pull request already exists
enhancement

New feature
infrastructure

Involves changes to the server setups, use `bug/infrastructure` for infrastructure-related user errors.
legal

An issue directly involving legal compliance
licence / ToS

involving questions about the ToS, especially licencing compliance
please chill
we are volunteers

Please consider editing your posts and remember that there is a human on the other side. We get that you are frustrated, but it's harder for us to help you this way.
public relations

Things related to Codeberg's external communication
question

More information is needed
question
user support

This issue contains a clearly stated problem. However, it is not clear whether we have to fix anything on Codeberg's end, but we're helping them fix it and/or find the cause.
s/Forgejo

Related to Forgejo. Please also check Forgejo's issue tracker.
s/Forgejo/migration

Migration related issues in Forgejo
s/Pages

Issues related to the Codeberg Pages feature
s/Weblate

Issue is related to the Weblate instance at https://translate.codeberg.org
s/Woodpecker

Woodpecker CI related issue
security

involves improvements to the sites security
service

Add a new service to the Codeberg ecosystem (instead of implementing into Gitea)
upstream

An open issue or pull request to an upstream repository to fix this issue (partially or completely) exists (i.e. Gitea, Forgejo, etc.)
wontfix

Codeberg's current set of contributors are not planning to spend time on delegating this issue.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/Community#935
Reference in a new issue
Codeberg/Community
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?