Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix permissions on Include #488

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/en/docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ hide:

- Internal pattern for OAuth2 form password.
- Fixed internal typings of passthrough in Response and TemplateResponse.
- Esmerald permissions on Include were being overriten by Lilya too early.

## 3.6.3

Expand Down
2 changes: 1 addition & 1 deletion esmerald/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "3.6.3"
__version__ = "3.6.4"


from lilya import status
Expand Down
4 changes: 3 additions & 1 deletion esmerald/routing/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -2878,7 +2878,6 @@ async def another(request: Request) -> str:

self.dependencies = dependencies or {}
self.interceptors: Sequence[Interceptor] = interceptors or []
self.permissions: Sequence[Permission] = permissions or [] # type: ignore
self.response_class = None
self.response_cookies = None
self.response_headers = None
Expand All @@ -2904,6 +2903,9 @@ async def another(request: Request) -> str:
redirect_slashes=redirect_slashes,
)

# Making sure Esmerald uses the Esmerald permission system and not Lilya's.
self.permissions: Sequence[Permission] = permissions or [] # type: ignore

def resolve_app_parent(self, app: Optional[Any]) -> Optional[Any]:
"""
Resolves the owner of ChildEsmerald or Esmerald iself.
Expand Down