Skip to content
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 to restrict users by default #16256

Merged

Conversation

rjnienaber
Copy link
Contributor

Resolves #427.

Adds a configuration option to app.ini that makes new users have the IsRestricted permission set to true by default.

@6543 6543 added the type/enhancement An improvement of existing functionality label Jun 26, 2021
@6543 6543 added this to the 1.16.0 milestone Jun 26, 2021
setting this in the model messes with other workflows (e.g. syncing LDAP users) where the IsRestricted permission needs to be explicitly set and not overridden by a config value
@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2021

Codecov Report

Merging #16256 (607ccd4) into main (0393a57) will increase coverage by 1.25%.
The diff coverage is 53.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16256      +/-   ##
==========================================
+ Coverage   44.24%   45.49%   +1.25%     
==========================================
  Files         695      709      +14     
  Lines       82341    83743    +1402     
==========================================
+ Hits        36429    38099    +1670     
+ Misses      40014    39510     -504     
- Partials     5898     6134     +236     
Impacted Files Coverage Δ
cmd/convert.go 0.00% <0.00%> (ø)
cmd/dump_repo.go 0.00% <0.00%> (ø)
cmd/generate.go 0.00% <0.00%> (ø)
cmd/hook.go 0.00% <0.00%> (ø)
cmd/migrate.go 0.00% <0.00%> (ø)
cmd/migrate_storage.go 0.00% <0.00%> (ø)
cmd/serv.go 2.36% <0.00%> (-0.22%) ⬇️
cmd/web.go 0.00% <0.00%> (ø)
models/action.go 47.12% <ø> (ø)
models/convert.go 0.00% <0.00%> (ø)
... and 260 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27c1578...607ccd4. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 26, 2021
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 5, 2021
custom/conf/app.example.ini Outdated Show resolved Hide resolved
integrations/mssql.ini.tmpl Outdated Show resolved Hide resolved
integrations/mysql.ini.tmpl Outdated Show resolved Hide resolved
integrations/mysql8.ini.tmpl Outdated Show resolved Hide resolved
integrations/pgsql.ini.tmpl Outdated Show resolved Hide resolved
integrations/sqlite.ini.tmpl Outdated Show resolved Hide resolved
integrations/signup_test.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 6, 2021
@techknowlogick
Copy link
Member

🚀

@techknowlogick techknowlogick merged commit 908136c into go-gitea:main Jul 15, 2021
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 10, 2021
* add configuration option to restrict users by default

* default IsRestricted permission only set on sign up

setting this in the model messes with other workflows (e.g. syncing LDAP users) where the IsRestricted permission needs to be explicitly set and not overridden by a config value

* fix formatting

* Apply suggestions from code review

* ensure newly created user is set to restricted

* ensure imports are in the correct order

Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User with limited permissions when self registered
6 participants