mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-08-06 01:37:25 +08:00
Restrict creating organisations by user (#193)
* restrict creating organizations based on right on user * revert bindata.go * reverse vendor lib * revert goimports change * set AllowCreateOrganization default value to true * revert locale * added default value for AllowCreateOrganization * fix typo in migration-comment * fix comment * add coments in migration
This commit is contained in:
@ -97,6 +97,10 @@ func (org *User) RemoveOrgRepo(repoID int64) error {
|
||||
|
||||
// CreateOrganization creates record of a new organization.
|
||||
func CreateOrganization(org, owner *User) (err error) {
|
||||
if !owner.CanCreateOrganization() {
|
||||
return ErrUserNotAllowedCreateOrg{}
|
||||
}
|
||||
|
||||
if err = IsUsableUsername(org.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user