Expose SUBMIT_INCOME in permission management UI
Adds the new permission type to the grant/bulk-grant dialog dropdown (static/js/permissions.js) so admins can grant 'Submit Income' on revenue accounts the same way they grant 'Submit Expense' on expense accounts. Without this, the backend's SUBMIT_INCOME check on the new income endpoint is ungranted-able from the UI and users see a 403. Uses 'teal' + the 'payments' icon to distinguish income-grant badges from green-and-add_circle expense-grant badges in the role/account permission lists. Also updates a stale comment in migrations.py listing the valid permission_type values. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
93b5c2677c
commit
61952d0015
2 changed files with 10 additions and 1 deletions
|
|
@ -240,7 +240,7 @@ async def m001_initial(db):
|
||||||
# ACCOUNT PERMISSIONS TABLE
|
# ACCOUNT PERMISSIONS TABLE
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
# Granular access control for accounts
|
# Granular access control for accounts
|
||||||
# Permission types: read, submit_expense, manage
|
# Permission types: read, submit_expense, submit_income, manage
|
||||||
# Supports hierarchical inheritance (parent account permissions cascade)
|
# Supports hierarchical inheritance (parent account permissions cascade)
|
||||||
|
|
||||||
await db.execute(
|
await db.execute(
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,11 @@ window.app = Vue.createApp({
|
||||||
label: 'Submit Expense',
|
label: 'Submit Expense',
|
||||||
description: 'Submit expenses to this account'
|
description: 'Submit expenses to this account'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
value: 'submit_income',
|
||||||
|
label: 'Submit Income',
|
||||||
|
description: 'Submit income/revenue entries to this account'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
value: 'manage',
|
value: 'manage',
|
||||||
label: 'Manage',
|
label: 'Manage',
|
||||||
|
|
@ -501,6 +506,8 @@ window.app = Vue.createApp({
|
||||||
return 'blue'
|
return 'blue'
|
||||||
case 'submit_expense':
|
case 'submit_expense':
|
||||||
return 'green'
|
return 'green'
|
||||||
|
case 'submit_income':
|
||||||
|
return 'teal'
|
||||||
case 'manage':
|
case 'manage':
|
||||||
return 'red'
|
return 'red'
|
||||||
default:
|
default:
|
||||||
|
|
@ -514,6 +521,8 @@ window.app = Vue.createApp({
|
||||||
return 'visibility'
|
return 'visibility'
|
||||||
case 'submit_expense':
|
case 'submit_expense':
|
||||||
return 'add_circle'
|
return 'add_circle'
|
||||||
|
case 'submit_income':
|
||||||
|
return 'payments'
|
||||||
case 'manage':
|
case 'manage':
|
||||||
return 'admin_panel_settings'
|
return 'admin_panel_settings'
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue