Skip to content
Snippets Groups Projects
  • Saurabh Kumar's avatar
    8f16bd23
    Add rolespermissions module, refractor the group and delete submission to use it (#4151) · 8f16bd23
    Saurabh Kumar authored
    Updates group management:
    
    - **Centralized Group Definition:** Instead of creating groups within
    migration files, which can be cumbersome to maintain, group definitions
    are now managed through the AbstractRoles model. These roles are
    synchronized using the `python manage.py sync_roles` command. This
    ensures no existing groups or their associated permissions are deleted.
    
    - **Module Renaming**: The `hypha.apply.users.groups` module has been
    renamed to `hypha.apply.users.roles` to reflect the shift from
    group-based to role-based permissions. This aligns with upcoming changes
    utilizing the `rolepermissions` module.
    
    - **Streamlined Group Descriptions**: The GroupDesc model is removed.
    Instead, help text can be directly defined within the role itself. This
    simplifies management and allows for translation of group descriptions.
    
    **This is the first of a series of pull requests aimed at refactoring
    the permissions system.**
    
    As a sample implementation, converts the delete submission to use this
    role-permissions. See:
    https://github.com/HyphaApp/hypha/pull/4151/commits/8239c2172ab9150cdba0db8d95f13e1681f176cd
    
    ## Test Steps
    
     - make sure the migrations run fine.
    - groups are create correctly via `python manage.py sync_roles`, it
    should also keep the existing groups.
     -  groups description is rendered in the admin.
     - ensure delete submission/application is working as expected
    Add rolespermissions module, refractor the group and delete submission to use it (#4151)
    Saurabh Kumar authored
    Updates group management:
    
    - **Centralized Group Definition:** Instead of creating groups within
    migration files, which can be cumbersome to maintain, group definitions
    are now managed through the AbstractRoles model. These roles are
    synchronized using the `python manage.py sync_roles` command. This
    ensures no existing groups or their associated permissions are deleted.
    
    - **Module Renaming**: The `hypha.apply.users.groups` module has been
    renamed to `hypha.apply.users.roles` to reflect the shift from
    group-based to role-based permissions. This aligns with upcoming changes
    utilizing the `rolepermissions` module.
    
    - **Streamlined Group Descriptions**: The GroupDesc model is removed.
    Instead, help text can be directly defined within the role itself. This
    simplifies management and allows for translation of group descriptions.
    
    **This is the first of a series of pull requests aimed at refactoring
    the permissions system.**
    
    As a sample implementation, converts the delete submission to use this
    role-permissions. See:
    https://github.com/HyphaApp/hypha/pull/4151/commits/8239c2172ab9150cdba0db8d95f13e1681f176cd
    
    ## Test Steps
    
     - make sure the migrations run fine.
    - groups are create correctly via `python manage.py sync_roles`, it
    should also keep the existing groups.
     -  groups description is rendered in the admin.
     - ensure delete submission/application is working as expected
conftest.py 344 B