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

API /admin/users/{username} Edit an existing user is missing for allow_create_organization #4765

Closed
1 of 5 tasks
EnricoFerro opened this issue Aug 22, 2018 · 4 comments
Closed
1 of 5 tasks
Labels
modifies/api This PR adds API routes or modifies them type/enhancement An improvement of existing functionality

Comments

@EnricoFerro
Copy link
Contributor

  • Gitea version (or commit ref): Actual ( Probably from d67b278 )
  • Git version:
  • Operating system:
  • Database (use [x]):
    • [ x] PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • [ x] Yes
    • No
    • Not relevant
  • Log gist:

Description

In the user setting is possible to set the creation of the organization from the flag "May Create Organizations"
image

The API EDIT USER /admin/users/{username} is missing of the flag allow_create_organization in the Model that simulate this flag

Changes

This is a ( probably incomplete ) list of the files to modify (Sorry I don't know Go... :-( )
File to modify:

adding lines:

if form.AllowCreateOrganization != nil {
u.AllowCreateOrganization = *form.AllowCreateOrganization
}


"allow_import_local": {

adding lines:

"allow_create_organization": {
"type": "boolean",
"x-go-name": "AllowCreateOrganization"
},

@lafriks lafriks added type/enhancement An improvement of existing functionality modifies/api This PR adds API routes or modifies them labels Aug 22, 2018
@daviian
Copy link
Member

daviian commented Aug 22, 2018

I think we should also discuss aligning the API models for user creation and editing? Or am I missing a detail why these are different in the first place?

EnricoFerro pushed a commit to EnricoFerro/gitea that referenced this issue Aug 22, 2018
@EnricoFerro
Copy link
Contributor Author

For the creation and edit there are a lot of difference in the frontend.
I agree in an a scenario of FULL Rest API the creation is missing of a lot of information.

In the actual scenario the API follow the frontend ( without the : May Create Organization and Disable Sign-In )
Creation: API have more field than the frontend
Edit: is missing for the API prohibit_login and allow_create_organization

CREATION:

Field Type Mapping ( Frontend )
email string Email Address
full_name string ( Not present )
login_name string ???
password* string Password
send_notify boolean Send User Registration
source_id integer($int64) Authentication Source
username* string Username

EDIT:

Field Type Mapping ( Frontend )
active boolean User Account Is Activated
admin boolean Is Administrator
allow_git_hook boolean May Create Git Hooks
allow_import_local boolean May Import Local Repository
email* string($email) Email Address
full_name string Full Name
location string Location
login_name string ???
max_repo_creation integer($int64) Maximal Number of Repositories
password string Password
source_id integer($int64) Authentication Source
website string Website
prohibit_login boolean Disable Sign-In
allow_create_organization boolean Is Administrator

@EnricoFerro
Copy link
Contributor Author

EnricoFerro commented Aug 23, 2018

Create a Pull request #4774 that implement this Isssue
Create a Pull request #4775 that implement this Isssue

@EnricoFerro
Copy link
Contributor Author

#4775 Merged.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

3 participants