GetAssigneeByID returns the user that has write access of repository by given ID.
(userID int64)
| 540 | |
| 541 | // GetAssigneeByID returns the user that has write access of repository by given ID. |
| 542 | func (r *Repository) GetAssigneeByID(userID int64) (*User, error) { |
| 543 | ctx := context.TODO() |
| 544 | if !Handle.Permissions().Authorize( |
| 545 | ctx, |
| 546 | userID, |
| 547 | r.ID, |
| 548 | AccessModeRead, |
| 549 | AccessModeOptions{ |
| 550 | OwnerID: r.OwnerID, |
| 551 | Private: r.IsPrivate, |
| 552 | }, |
| 553 | ) { |
| 554 | return nil, ErrUserNotExist{args: errutil.Args{"userID": userID}} |
| 555 | } |
| 556 | return Handle.Users().GetByID(ctx, userID) |
| 557 | } |
| 558 | |
| 559 | // GetWriters returns all users that have write access to the repository. |
| 560 | func (r *Repository) GetWriters() (_ []*User, err error) { |
no test coverage detected