Skip to content

Update roles and nickname fields to be optiona#190

Merged
wu-clan merged 7 commits into
fastapi-practices:masterfrom
wu-clan:update-create-user
Jul 31, 2023
Merged

Update roles and nickname fields to be optiona#190
wu-clan merged 7 commits into
fastapi-practices:masterfrom
wu-clan:update-create-user

Conversation

@wu-clan

@wu-clan wu-clan commented Jul 29, 2023

Copy link
Copy Markdown
Member

PLR.

@wu-clan
wu-clan requested a review from downdawn July 29, 2023 12:54
@downdawn

Copy link
Copy Markdown
Collaborator

Do we no longer need to specify the department and role when creating a user?

@wu-clan

wu-clan commented Jul 29, 2023

Copy link
Copy Markdown
Member Author

No, if you register via the registration link in the login screen, it will only contain the username, password and email address.

If you add a user through the backend, you can select the department and role directly, and the department and role are useful for backend permission checking.

Here the front and back end you can understand: Users look at the information presentation interface, the background staff can see the management interface

@downdawn

Copy link
Copy Markdown
Collaborator

I understand what you mean.
During registration, the frontend may only require the user to provide a username and password, and the department field can be left empty. However, there should be a default role assigned, otherwise, how would we allocate menus and permissions?

@wu-clan

wu-clan commented Jul 30, 2023

Copy link
Copy Markdown
Member Author

Departments and roles have to be assigned centrally by the administrator, as it's a matter of permissions

I don't think user registration should include departments and roles, but rather assign them at a later stage

@wu-clan

wu-clan commented Jul 30, 2023

Copy link
Copy Markdown
Member Author

Adding new users will be divided into two interfaces

  1. user registration will be realized through the login interface link, which does not contain fields related to permissions
  2. user addition will be realized through the back-end management, which contains department and role
    selection

Ongoing, subject to prioritized review #191

@downdawn

Copy link
Copy Markdown
Collaborator

When is the later stage allocation?
What default pages can a registered user see by default without a role assignment menu?

@wu-clan

wu-clan commented Jul 31, 2023

Copy link
Copy Markdown
Member Author

This is exactly what the staff field is for, users don't support backend admin login by default, which means they can't see the backend admin interface unless the administrator assigns rights to it

When no role menu is assigned, we need to modify the front-end to set the dashboard to be owned by all users by default, to avoid displaying the 404 interface directly

@wu-clan

wu-clan commented Jul 31, 2023

Copy link
Copy Markdown
Member Author

This is designed to differentiate between external users and insiders, however, we will not be implementing anything related to the external user interface

@wu-clan
wu-clan merged commit b41aca5 into fastapi-practices:master Jul 31, 2023
@wu-clan
wu-clan deleted the update-create-user branch July 31, 2023 03:52
chuxijin pushed a commit to chuxijin/fba that referenced this pull request Feb 8, 2026
* Update roles and nickname fields to be optional

* Update the department and role fields is optional

* fix role judgment

* New add user interface

* update interface permissions

* fix nickname judgment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants