User Roles and Permissions

Authorization

  1. Start: Initial state of the authorization process.
  2. User Logs In: The user attempts to log in.
  3. Session Check: The system checks if the user's session is valid.
    • Invalid Session: An error message is displayed.
    • Valid Session: The system checks if the user is approved.
  4. Check User Approval: Core of the authorization check, where the system verifies if the user's ID is in the list of approved IDs for the requested path.
    • User Approved: The user is approved, and the requested content is displayed.
    • User Not Approved: The user is not approved, and an access denied message is shown.
+---------------------------------+
|             Start               |
+---------------------------------+
            |
            v
+---------------------------------+
|           User Logs In          |
+---------------------------------+
            |
            v
+---------------------------------+
|          Session Check          |
+---------------------------------+
          /      |       \
         /       |        \
        /        |         \
       v         |          v
+---------------------------+ +---------------------------+
|      Invalid Session      | |       Valid Session       |
|   Show Error Message      | |   Check User Approval     |
+---------------------------+ +---------------------------+
            |                       /          \
            |                      /            \
            v                     /              \
+---------------------------+    v                v
|  Show Error Message       | +----------------+ +---------------------------+
|                           | | User Approved  | |   User Not Approved       |
|                           | | Display Content| |   Show Access Denied Msg  |
+---------------------------+ +----------------+ +---------------------------+

Description:

  • Start: The process begins.
  • User Logs In: The user attempts to log in.
  • Session Check: Checks if the user's session is valid.
    • If the session is invalid, it shows an error message.
    • If the session is valid, it proceeds to check if the user is approved.
  • Check User Approval: Checks if the user's ID is in the list of approved IDs.
    • If the user is approved, the content is displayed.
    • If the user is not approved, an access denied message is shown.