[UPDT] LEAVE: Introduce can_view_on_leave permission to control On Leave dashboard access

This commit is contained in:
Horilla
2025-12-03 14:52:47 +05:30
parent 92761dfa5e
commit 8bb8bf51ed
3 changed files with 25 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
# Generated by Django 5.2.8 on 2025-12-03 09:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("leave", "0001_initial"),
]
operations = [
migrations.AlterModelOptions(
name="leaverequest",
options={
"ordering": ["-id"],
"permissions": (("can_view_on_leave", "Can View On Leave"),),
"verbose_name": "Leave Request",
"verbose_name_plural": "Leave Requests",
},
),
]

View File

@@ -950,8 +950,9 @@ class LeaveRequest(HorillaModel):
class Meta:
ordering = ["-id"]
verbose_name = "Leave Request"
verbose_name_plural = "Leave Requests"
verbose_name = _("Leave Request")
verbose_name_plural = _("Leave Requests")
permissions = (("can_view_on_leave", "Can View On Leave"),)
def comment_action(self):
"""