Go to file
Alejandro Sirgo Rica 977b457d5c ogcp: add user permission mechanism
Add a new user permission system to control the allowed operations
accessible from each account.

Add a permission matrix editable through the user/add and user/edit
views. The permission matrix has client, center, room, folder, image
and repository as permission targets and add, update and delete as
permission types.

Restrict each view based on the user permissions, hide all actions
from not autheticated users.

permissions defined in the class UserForm.

Serialize each user permissions into ogcp.json as:
{
  ...
  "USERS" [
    {
      "USER": "admin"
      ...
      "PERMISSIONS": {
        "CLIENT": {
          "ADD": true,
          "UPDATE": true,
          "DELETE": true,
        },
        ... <- same structure for "CENTER", "ROOM", "FOLDER", "IMAGE"
               and "REPOSITORY"
      }
    },
    ...
  ],
  ...
}

Grant all the permissions to old user configuration to not disrupt their
workflow. The administrator will need to assign the permissions for each
user.

Ignore scope and permission restrictions for admin users.

Save permissions and scopes even if the user is admin to account for the
case of a temporal admin promotion without losing the previous
configuration.

Use template inheritance for add_user.html and edit_user.html to prevent
big code duplication with the new HTML code to render the permission
matrix.

Make user administration an admin only feature.

Define methods get_permission and target_is_disabled to improve readability
in template conditionals that disable features based on user permissions.
2024-06-27 10:03:14 +02:00
ogcp ogcp: add user permission mechanism 2024-06-27 10:03:14 +02:00
.gitignore Add gitignore 2020-08-28 10:18:43 +02:00
COPYING Add README.md and COPYING files 2021-05-21 11:18:08 +02:00
README.md Add README.md and COPYING files 2021-05-21 11:18:08 +02:00
requirements.txt Add login 2021-03-05 11:47:27 +01:00
run_test.sh Add run_test.sh script 2020-10-27 10:38:56 +01:00

README.md

ogCP

ogCP (OpenGnsys Control Panel) is the new web interface, a modern alternative to the classical administration panel (WebConsole).

Installation

Steps to install ogCP on Ubuntu 18.04 LTS:

  • Clone the repository that is temporarily available at: https://github.com/javsanpar/ogCP
  • Edit ogcp/cfg/ogcp.json and include the API token and the IP address of the ogServer. In addition, we must define the user and the key we want for authentication in ogCP.
  • Create a python virtual environment.
    • Install venv with:
      apt-get install python3-venv
      
    • Create the folder where we will start the virtual environment.
    • Create the virtual environment with:
      python3 -m venv ./previous-folder
      
  • Activate the shell with the virtual environment with:
    source ./previous-folder/bin/activate
    
  • (Optional) If you want to expose ogCP to other machines, you must edit run_test.sh with:
    ...
    flask run --host=0.0.0.0
    
  • With the shell linked to the newly created python environment, navigate to the folder where you cloned ogCP and launch:
    ./run_test.sh
    
    When running run_test.sh for the first time some errors are expected, but they do not affect to the usability of ogCP.

License

ogCP is released under the GNU Affero Public License v3+

Authors

Soleta Networks