Fork permission bug fixes (#2534)

* Hotfix for "Add time manually" (https://github.com/go-gitea/gitea/pull/2211#issuecomment-328780125)

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Checking if Code unit is enabled before creating a fork.

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Adding a discrete function for RepoIDAssignment

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Improved Documentation
This commit is contained in:
Jonas Franz 2017-09-18 16:52:20 +02:00 committed by Lunny Xiao
parent 6c6533fb31
commit 566e8ecce0
3 changed files with 73 additions and 3 deletions

View file

@ -638,7 +638,7 @@ func (repo *Repository) UpdateSize() error {
// CanBeForked returns true if repository meets the requirements of being forked.
func (repo *Repository) CanBeForked() bool {
return !repo.IsBare
return !repo.IsBare && repo.UnitEnabled(UnitTypeCode)
}
// CanEnablePulls returns true if repository meets the requirements of accepting pulls.