Skip to content

Commit

Permalink
Prepare 0.1.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanpetrea committed Feb 15, 2024
1 parent 635e2cc commit 2f7fe9a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 23 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.2] - 2024-02-14

## [0.1.3] - 2024-02-15
### Changes
- 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.


## [0.1.2 - REMOVED] - 2024-02-14
### Changes
These are **Breaking Changes**, but the project hasn't been announced yet anyway:
- Renamed `uuid` PKs to simply `id`, and changed the AssignedPerms PK field to UUID7 too.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# django-woah
A package intended to aid developers in implementing authorization for Django apps.

*This project is developed at [Presslabs](https://www.presslabs.com/).*

## Installation
Expand Down Expand Up @@ -55,8 +56,8 @@ Now, let's define an AuthorizationScheme for our Issue model, starting with some
```python
# my_app/issue_tracker/authorization.py
# Here you can define authorization schemes for your models
from django_woah.authorization import ModelAuthorizationScheme, PermEnum

from django_woah.authorization import ModelAuthorizationScheme, PermEnum

class IssueAuthorizationScheme(ModelAuthorizationScheme):
model = Issue
Expand Down Expand Up @@ -97,7 +98,7 @@ class IssueAuthorizationScheme(ModelAuthorizationScheme):
]
```

Now we might want to ensure that only members/collaborators of the same organization that owns the issue may receive authorization. For that we must establish the owner_relation (field) of the Issue model, and set up an implicit condition that will represent our Membership check.
Now we might want to ensure that only members/collaborators of the organization that owns the issue may receive authorization. For that we must establish the owner_relation (field) of the Issue model, and set up an implicit condition that will represent our Membership check.
```python
# my_app/issue_tracker/authorization.py

Expand Down
7 changes: 7 additions & 0 deletions django_woah/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ class Migration(migrations.Migration):
name="unique_usergroup_owner_kind_related_user",
),
),
migrations.AddConstraint(
model_name="usergroup",
constraint=models.UniqueConstraint(
fields=("owner", "parent", "kind", "name"),
name="unique_usergroup_localized_name",
),
),
migrations.AddConstraint(
model_name="membership",
constraint=models.UniqueConstraint(
Expand Down
19 changes: 0 additions & 19 deletions django_woah/migrations/0002_usergroup_unique_name.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-woah"
version = "0.1.2"
version = "0.1.3"
description = "A package intended to aid developers in implementing authorization for Django apps."
authors = ["Bogdan Petrea <bogdan@presslabs.com>"]
maintainers = ["Bogdan Petrea <bogdan@presslabs.com>"]
Expand Down

0 comments on commit 2f7fe9a

Please sign in to comment.