mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-12-19 23:35:04 +01:00
Merge branch 'master' of gitlab.com:allianceauth/allianceauth into v4.x
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
## Base functionality
|
||||
|
||||
The URL hooks allow you to dynamically specify URL patterns from your plugin app or service. To achieve this you should subclass or instantiate the `services.hooks.UrlHook` class and then register the URL patterns with the hook.
|
||||
The URL hooks allow you to dynamically specify URL patterns from your plugin app or service. To achieve this, you should subclass or instantiate the `services.hooks.UrlHook` class and then register the URL patterns with the hook.
|
||||
|
||||
To register a UrlHook class you would do the following:
|
||||
To register a UrlHook class, you would do the following:
|
||||
|
||||
```python
|
||||
@hooks.register('url_hook')
|
||||
@@ -26,12 +26,12 @@ The URL prefix to match against in regex form. Example `r'^app_name/'`. This pre
|
||||
|
||||
### Public views
|
||||
|
||||
In addition is it possible to make views public. Normally, all views are automatically decorated with the `main_character_required` decorator. That decorator ensures a user needs to be logged in and have a main before he can access that view. This feature protects against a community app sneaking in a public view without the administrator knowing about it.
|
||||
In addition, is it possible to make views public. Normally, all views are automatically decorated with the `main_character_required` decorator. That decorator ensures a user needs to be logged in and have a main before he can access that view. This feature protects against a community app sneaking in a public view without the administrator knowing about it.
|
||||
|
||||
An app can opt-out of this feature by adding a list of views to be excluded when registering the URLs. See the `excluded_views` parameter for details.
|
||||
An app can opt out of this feature by adding a list of views to be excluded when registering the URLs. See the `excluded_views` parameter for details.
|
||||
|
||||
:::{note}
|
||||
Note that for a public view to work, administrators need to also explicitly allow apps to have public views in their AA installation, by adding the apps label to ``APPS_WITH_PUBLIC_VIEWS`` setting.
|
||||
Note that for a public view to work, administrators need to also explicitly allow apps to have public views in their AA installation, by adding the app label to ``APPS_WITH_PUBLIC_VIEWS`` setting.
|
||||
:::
|
||||
|
||||
>>>>>>>
|
||||
@@ -55,7 +55,7 @@ urlpatterns = [
|
||||
]
|
||||
```
|
||||
|
||||
Subsequently it would implement the UrlHook in a dedicated `auth_hooks.py` file like so:
|
||||
Subsequently, it would implement the UrlHook in a dedicated `auth_hooks.py` file like so:
|
||||
|
||||
```python
|
||||
from alliance_auth import hooks
|
||||
|
||||
Reference in New Issue
Block a user