-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add configuration option for default permission to create Organizations #1686
Add configuration option for default permission to create Organizations #1686
Conversation
…reate Organizations
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding new config variables should not break the old behaviour.
conf/app.ini
Outdated
@@ -240,6 +240,9 @@ ENABLE_CAPTCHA = true | |||
; Default value for KeepEmailPrivate | |||
; New user will get the value of this setting copied into their profile | |||
DEFAULT_KEEP_EMAIL_PRIVATE = false | |||
; Default value for AllowCreateOrganization | |||
; New user will get the value of this setting copied into their profile | |||
DEFAULT_ALLOW_CREATE_ORGANIZATION = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default to true
otherwise backwards compatability is broken.
@@ -45,12 +45,12 @@ | |||
margin: 0; | |||
|
|||
dd { | |||
margin-left: 240px; | |||
margin-left: 275px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this change necessary? Got any screenshots of how it looks before and after?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise "Default permission to create Organizations" did not if in, it was cut to something like "Default permission to crea..."
} | ||
dt { | ||
font-weight: bolder; | ||
float: left; | ||
width: 250px; | ||
width: 285px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
@@ -972,6 +972,7 @@ var Service struct { | |||
EnableReverseProxyAutoRegister bool | |||
EnableCaptcha bool | |||
DefaultKeepEmailPrivate bool | |||
DefaultAllowCreateOrganization bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has to default to true
to not break the old behaviour
Please update the default behavior as @bkcsoft suggestions. Otherwise L-G-T-M |
modules/setting/setting.go
Outdated
@@ -992,6 +993,7 @@ func newService() { | |||
Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool() | |||
Service.EnableCaptcha = sec.Key("ENABLE_CAPTCHA").MustBool() | |||
Service.DefaultKeepEmailPrivate = sec.Key("DEFAULT_KEEP_EMAIL_PRIVATE").MustBool() | |||
Service.DefaultAllowCreateOrganization = sec.Key("DEFAULT_ALLOW_CREATE_ORGANIZATION").MustBool() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to set default to true here. Changing app.ini doesn't do anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 👍
Changed default to keep backward compatibility but I would like gitea to reconsider more sane default in the future. When adding this setting it should have not introduced such changes in default behavior. I see it could be useful only in deployments where gitea is used as SasS, in private repositories there would mostly also be only one person who will create organizations, in organizations that will do administrators. |
LGTM |
LG-TM, please work :) |
Defaults to false