-
Notifications
You must be signed in to change notification settings - Fork 710
Fix(attendance): Implements permission check for manual clock-in/out.… #952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.0
Are you sure you want to change the base?
Fix(attendance): Implements permission check for manual clock-in/out.… #952
Conversation
… Restricts access to users with 'attendance.can_manual_login_logout' permission, resolving Issue horilla-opensource#821.
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
53311e0 to
be056f3
Compare
…ttendance-restriction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready For Review
This pull request addresses Issue #821 by implementing the necessary logic to restrict the manual attendance (clock-in/clock-out) feature based on user permission.
The goal is to ensure only authorized personnel who possess the specific permission can utilize the feature.
Changes Implemented:
if not request.user.has_perm('attendance.can_manual_login_logout'):) was added to the beginning of both theclock_inandclock_outviews.attendance/views/clock_in_out.py.200(OK) instead of403(Forbidden) to ensure HTMX successfully renders the custom denial message (Manual Attendance Restricted) on the Navbar without the button disappearing.Verification (Testing):
attendance.can_manual_login_logoutpermission can successfully use both the Check-In and Check-Out buttons.Closes Issue #821.