-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Automatically reload updated rights #16308
Automatically reload updated rights #16308
Conversation
This PR is a continuation of #16031 and its discussions |
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.
Works perfectly 👍(with the suggested changes)
b576329
to
fd46630
Compare
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.
-
Migration
class tests should be updated to ensure thatlast_rights_update
field is correctly updated. -
The
last_rights_update
should be updated too when the profile is changed using theProfile::update()
method (probably in replacement of theProfileRight::forceCurrentSessionRights()
method). Tests should be added this behaviour too.
bf37bfe
to
702d7e9
Compare
ca092dd
to
68dbdd7
Compare
Description:
This PR introduces a dynamic rights management system, primarily through the addition of a new field
last_rights_update
in theglpi_profiles
table. This field is used to track the last update of the rights associated with a profile. Whenever a right is added, updated, or deleted, this field is updated with the current timestamp. This allows us to easily identify when a profile's rights were last modified and reload them "on the fly" when necessary.Changes:
last_rights_update
field toglpi_profiles
table inprofiles.php
migration file andglpi-empty.sql
file.Migration.php
to setlast_rights_update
whenever a right is added, updated, or deleted.Session.php
to reload the current profile if thelast_rights_update
timestamp is more recent than the one stored in the session.reloadCurrentProfile
inSession.php
to reload the current profile from the database.testReloadCurrentProfile
inSession.php
test file to verify the correct functionality of thereloadCurrentProfile
method.