Skip to content

Feature: Access Control Enchancements#15

Merged
arg3t merged 12 commits intomainfrom
feature/access_control
Mar 8, 2025
Merged

Feature: Access Control Enchancements#15
arg3t merged 12 commits intomainfrom
feature/access_control

Conversation

@arg3t
Copy link
Contributor

@arg3t arg3t commented Mar 8, 2025

Description

This PR re-implements the access control mechanism such that:

  • Each note has a privilege vector associated with it
  • This vector is propagated into relations
  • Each entity is an item in the vector. If a note requires access to entity A then that index of the privilege vector is set to 1, otherwise 0
  • A user's access level is also a vector, access into a note is decided by strictly comparing each item in the vector
  • BREAKING Now, a maximum of 2048 entities are supported. This number can be increased in the future in exchange for a small hit on performance.
  • BREAKING After migrating, users need to run pipenv run python manage.py calculate_acvecs in order to properly initialize the access control vectors. Otherwise they won't work

Fixes #11 & #1

Affected Components

Please indicate which parts of the application this PR concerns. For example, you can include any of the following:

  • Frontend
  • Backend

Type of Change

  • Bug fix
  • New feature
  • Breaking change

Checklist

  • I have performed a self-review of my own code.
  • I have commented my code where necessary.
  • I have made corresponding changes to the documentation.
  • My changes do not produce any new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • Any dependent changes have been merged and published.

@arg3t arg3t merged commit 86953a0 into main Mar 8, 2025
3 checks passed
@arg3t arg3t deleted the feature/access_control branch March 8, 2025 04:39
@arg3t arg3t changed the title Feature: Access Control enchancements Feature: Access Control Enchancements Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TODO] Switch to Bit-Vectors for Access Control

2 participants