AgileConfig was originally designed as a tool for my own use, so I only set an administrator password without the concept of user. However, many students put forward suggestions that need multi-user support after using it. It’s very inconvenient to have an entire team or company using the same password. Today, AgileConfig 1.3.0 finally supports multiple users and simple permission management. The design of users and permissions is often involved in the development of management systems, and the most commonly used is RBAC role-based permission control. However, based on the simple concept of AgileConfig, I slightly simplified the functional design of permission control to reduce learning costs as much as possible.

Permission to design

AgileConfig’s permission design is divided into three fixed roles:

  1. Super administrator

The super administrator can add, modify, and delete users, applications, configurations, and other information at will. 2. Administrator A common administrator can create an application, delete or modify its application (the administrator attribute of the application is the current user), and the configuration items of the application. The administrator can grant the management rights of the configuration items of the application to any user. The administrator can add or delete an operator user. 3. Operator An operator has no control over applications and can only edit or publish configuration items of applications authorized by the administrator.

User management

With multi-user support added in version 1.3.0, user management is a must.

After logging in to the system as an administrator, click User => Add. The page for adding a user is displayed.

After adding the user name, Password, and team information, select a user role. Click ok to create a user. After the message is displayed, you can log in to the system as the user.

Application of authorization

Version 1.3.0 supports simple authorization management for users.

An administrator can maintain an administrator when creating or editing an application. The account has full control rights over the application.

If you want other users to edit configuration items, you can authorize them on the authorization screen. Click the “Authorization” button to pop up the authorization interface.

Permissions are divided into two parts:

  1. Configuration modification right: permission to modify, delete, and query configuration items
  2. Configure online and offline rights: The online and offline rights of configuration items.

Upgrade the database structure that needs to be updated

Due to the addition of multi-user support in 1.3, several tables and fields were added, resulting in the program running error reported after upgrade 1.3 in 1.2, and the table structure needs to be manually adjusted. Mysql is used as an example:

  1. App_admin varchar(36)
  2. New agc_user table
CREATE TABLE `agc_user` (
  `id` varchar(36) NOT NULL,
  `user_name` varchar(50) DEFAULT NULL,
  `password` varchar(50) DEFAULT NULL,
  `salt` varchar(36) DEFAULT NULL,
  `team` varchar(50) DEFAULT NULL,
  `create_time` datetime(3) NOT NULL,
  `update_time` datetime(3) DEFAULT NULL,
  `status` enum('Normal','Deleted') NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
Copy the code
  1. New agc_user_app_auth table
CREATE TABLE `agc_user_app_auth` (
  `id` varchar(36) NOT NULL,
  `app_id` varchar(36) DEFAULT NULL,
  `user_id` varchar(36) DEFAULT NULL,
  `permission` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
Copy the code
  1. New agc_user_role table
CREATE TABLE `agc_user_role` (
  `id` varchar(36) NOT NULL,
  `user_id` varchar(50) DEFAULT NULL,
  `role` enum('SuperAdmin','Admin','NormalUser') NOT NULL,
  `create_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

Copy the code

Re-run the program after completing the new table and fields, it will prompt you to reset the super administrator password, and then you can use it normally.

The last

✨✨✨Github address: github.com/kklldog/Agi… Open source is not easy. Welcome to Star ✨✨✨

Demo Address: AgileConfig Server Demo Super administrator Account: admin Password: 123456