| | 1 | == Admin Registration(Existing Admin) |
| | 2 | |
| | 3 | === Authors: **Existing Admin** |
| | 4 | An existing admin promotes an already registered user to admin role, granting them full read-write access to the entire system. |
| | 5 | |
| | 6 | **1.** The admin navigates to the user management section of the platform. |
| | 7 | |
| | 8 | **2.** The system displays a list of all registered users. |
| | 9 | {{{#!sql |
| | 10 | SELECT user_id, username, email, name, surname |
| | 11 | FROM USERS |
| | 12 | ORDER BY created_at DESC; |
| | 13 | }}} |
| | 14 | |
| | 15 | **3.** The admin selects a user and assigns them the admin role. |
| | 16 | |
| | 17 | **4.** The system inserts a new record into the ADMINS table using the selected user's user_id. |
| | 18 | {{{#!sql |
| | 19 | INSERT INTO ADMINS (user_id) |
| | 20 | VALUES (1); |
| | 21 | }}} |
| | 22 | |
| | 23 | **5.** The system confirms the user has been successfully promoted to admin and sends them a notification. |
| | 24 | {{{#!sql |
| | 25 | INSERT INTO NOTIFICATION (content, is_read, created_at) |
| | 26 | VALUES ('You have been granted admin privileges on the platform.', FALSE, CURRENT_TIMESTAMP); |
| | 27 | }}} |