All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Preserve ordering when passing a
base_queryset
toAuthorizationSolver.get_authorized_resources_queryset
- Add a check for the first field in HasRelatedResourcePerms.relation
- Add uniqueness checks for PermEnum values
- Provide a DRF AuthorizationModelViewSet class for convenience
- Add initial support for simple DRF Views (non-Viewset)
- Added
get_root_membership
get_single_user_user_group
, andget_root_user_group
helper funcs. - Added experimental (as in this might be later removed) operators to Conditions, such that you could write some logic like:
def get_indirect_perms(self, context: Context) -> list[IndirectPerms]: return [ (HasRootMembership(context.actor) | HasSameResourcePerms([self.Roles.OWNER])) >> [ self.Perms.ACCOUNT_VIEW_MINIMAL, ], ]
- Lax some in-code assumptions to allow using non-Model classes
- Renamed
ModelAuthorizationScheme
sdirect_authorization_is_allowed
toallow_directly_assigned_perms
. Breaking Change - Renamed
get_or_create_root_user_group_for_account
helper func toget_or_create_root_user_group
. Breaking Change - Renamed
get_or_create_team_user_group_for_account
helper func toget_or_create_team_user_group
. Breaking Change
- Fixed a bunch of 500 errors in DRF browsable API mostly related to unsaved resources, but also DRF quirks.
- Handled some attribute traversal errors exceptions, where it was sensible to do so.
- Add a (semi) uniqueness constraint for UserGroup names. Reusing the initial migration, which is a Breaking Change, but as mentioned before, the project is not public yet.
These are Breaking Changes, but the project hasn't been announced yet anyway:
- Renamed
uuid
PKs to simplyid
, and changed the AssignedPerms PK field to UUID7 too. - Removed
display_name
from UserGroup and shrunkname
field to 80 chars.
- Changed the
object_id
field used for GenericForeignKey in AssignedPerm from TextField to CharField(max_length=40) to fix a MySQL indexing error. This is a Breaking Change, but the project hasn't been announced yet anyway. - Bump some deps.
- Initial release.