Frappe HR PWA: hide Quick Links and disable mobile check-in employee-wise?

Category: Frappe HR / Mobile App (PWA)
Version: HRMS v16.53.1, branch version-16

What I’m trying to do

In the Frappe HR mobile app (PWA) I need two things:

  1. Hide “Request Attendance” and “Request a Shift” from the Home screen Quick Links.
  2. Disable mobile check-in for some employees only, while the rest continue
    to check in normally from the app.

Requirement 1 — Quick Links are hardcoded

Quick Links are a hardcoded array in frontend/src/views/Home.vue (lines 29-65).
No doctype, HR Setting, or config drives this list, and the items render with no
permission check. The same two actions are duplicated as buttons in
frontend/src/views/attendance/Dashboard.vue (lines 6-12 and 32-38).

Requirement 2 — mobile check-in is all-or-nothing

This is the bigger blocker for us.

frontend/src/components/CheckInPanel.vue (line 7) gates the whole panel on a
single flag, allow_employee_checkin_from_mobile_app, returned by
hrms/api/__init__.py → get_hr_settings(). HR Settings is a Single doctype,
so this flag is site-wide. Turning it off hides check-in for every employee;
there is no per-employee or per-role variant.

Our actual use case: field staff should check in from the mobile app, while
office staff must not (they are covered by a biometric device). Today we can
only choose “mobile check-in for everyone” or “for nobody”.

The permission route does not solve it either:

  • Removing create permission on Employee Checkin does stop the record from
    being created, but the “Check In” button still renders. The employee taps it
    and gets a permission error, which looks like a bug to them.
  • Role permissions are doctype-level, not channel-level. So blocking mobile
    check-in for an employee also blocks their desk/web check-in. There is no way
    to restrict only the mobile channel.

Worth noting: permission-aware rendering already exists elsewhere in the PWA.
frontend/src/components/ListView.vue (line 26) calls
frappe.client.has_permission to conditionally show the create button. The
check-in panel simply does not do the same.

Why the usual customization tools don’t help

The PWA is served from hrms/www/hrms.html, which loads a standalone Vue
bundle. Client Scripts, Customize Form, Workspaces, and Website Theme custom CSS
are not injected into this page, so no desk-side customization tool can reach
these components.

Patching the Vue files works, but apps/hrms tracks the upstream repo, so the
change either conflicts or gets reverted on every bench update unless we
maintain a fork. For a visibility toggle that feels like a lot of ongoing cost.

Questions / suggestions

  1. Is there a supported way to control Quick Links visibility that I’ve missed?

  2. Could CheckInPanel.vue respect the user’s create permission on Employee
    Checkin, the way ListView.vue already does? This is a small change, follows
    an existing pattern in the app, needs no new settings, and would immediately
    make mobile check-in role-driven and therefore employee-wise.

  3. Longer term, would the team consider a per-employee or per-role mobile
    check-in setting, for example a field on Employee or Shift Type, instead of
    the single site-wide HR Settings flag?

  4. Same question for a configurable Quick Links list, by role or as a child
    table in HR Settings.

Happy to open a GitHub issue or send a PR if there is interest in a particular
approach.

This is a pretty reasonable request, especially when companies have field employees and office staff using different attendance methods.

I agree that checking permissions before showing the button would improve the experience, but it wouldn’t completely solve the problem if those employees still need access to check-in from the desk.

I think a per-employee mobile check-in setting would make more sense, with the restriction enforced on the backend too. The Quick Links should also respect permissions instead of being hardcoded.

That would give companies more flexibility without having to maintain custom changes after every update.

Hi @Meet-Tank4

Not sure but try this

Hope it helps

You can do the check-in part from a custom app, no fork needed. The PWA reads that flag from hrms.api.get_hr_settings, a whitelisted method. So in your app’s hooks.py, point override_whitelisted_methods for that path at your own function. Then return the flag per employee, say from a custom Check field:

import frappe
from hrms.api import get_hr_settings as original

@frappe.whitelist()
def get_hr_settings():
    s = original()
    if s.allow_employee_checkin_from_mobile_app:
        s.allow_employee_checkin_from_mobile_app = frappe.db.get_value(
            "Employee", {"user_id": frappe.session.user}, "custom_mobile_checkin")
    return s

This only hides the panel. You’d still want a server-side check. For Quick Links, I think you still need a patch.