Adds admin permissions management page
Implements an admin permissions management page. This change allows superusers to manage permissions directly from the castle interface, providing a more streamlined experience for administrative tasks.
This commit is contained in:
parent
9c63511371
commit
d7354556c3
2 changed files with 18 additions and 1 deletions
|
|
@ -16,10 +16,13 @@
|
|||
<h5 class="q-my-none">🏰 Castle Accounting</h5>
|
||||
<p class="q-mb-none">Track expenses, receivables, and balances for the collective</p>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="col-auto q-gutter-xs">
|
||||
<q-btn v-if="!isSuperUser" flat round icon="account_balance_wallet" @click="showUserWalletDialog">
|
||||
<q-tooltip>Configure Your Wallet</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn v-if="isSuperUser" flat round icon="admin_panel_settings" :href="'/castle/permissions'">
|
||||
<q-tooltip>Manage Permissions (Admin)</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn v-if="isSuperUser" flat round icon="settings" @click="showSettingsDialog">
|
||||
<q-tooltip>Castle Settings (Super User Only)</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
14
views.py
14
views.py
|
|
@ -17,3 +17,17 @@ async def index(
|
|||
return template_renderer(["castle/templates"]).TemplateResponse(
|
||||
request, "castle/index.html", {"user": user.json()}
|
||||
)
|
||||
|
||||
|
||||
@castle_generic_router.get(
|
||||
"/permissions",
|
||||
description="Permission management page",
|
||||
response_class=HTMLResponse,
|
||||
)
|
||||
async def permissions(
|
||||
request: Request,
|
||||
user: User = Depends(check_user_exists),
|
||||
):
|
||||
return template_renderer(["castle/templates"]).TemplateResponse(
|
||||
request, "castle/permissions.html", {"user": user.json()}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue