mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-21 00:20:50 +00:00
finish create issue with milestone and assignee
This commit is contained in:
parent
09a1b2a1f5
commit
75aff60c90
13 changed files with 275 additions and 206 deletions
|
@ -602,6 +602,17 @@ func GetUserByID(id int64) (*User, error) {
|
|||
return getUserByID(x, id)
|
||||
}
|
||||
|
||||
// GetAssigneeByID returns the user with write access of repository by given ID.
|
||||
func GetAssigneeByID(repo *Repository, userID int64) (*User, error) {
|
||||
has, err := HasAccess(&User{Id: userID}, repo, ACCESS_MODE_WRITE)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !has {
|
||||
return nil, ErrUserNotExist{userID, ""}
|
||||
}
|
||||
return GetUserByID(userID)
|
||||
}
|
||||
|
||||
// GetUserByName returns user by given name.
|
||||
func GetUserByName(name string) (*User, error) {
|
||||
if len(name) == 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue