cmsmanage/doorcontrol/dashboard.py

22 lines
545 B
Python
Raw Permalink Normal View History

import dashboard
from dashboard import Link
from .views import REPORTS
@dashboard.register
class DoorControlDashboardFragment(dashboard.LinksCardDashboardFragment):
name = "Door Controls"
@property
def links(self) -> list[Link]:
return [
Link(name, link, permission="doorcontrol.view_hidevent")
for report in REPORTS
for name, link in report._report_types()
]
@property
def visible(self) -> bool:
return self.request.user.has_perm("doorcontrol.view_hidevent")