pradosoft / prado

Prado - Component Framework for PHP
Other
187 stars 70 forks source link

Permissions Behaviors incorrectly reload TPermissionsManager due to new behavior __wakeup support #954

Closed belisoful closed 1 year ago

belisoful commented 1 year ago

This needs to be fixed before any 4.2.3. I have a fix for it immediately.

In essence, The TPermissions(Behaviors) keeps a reference to the Permissions Manager, but when __wakeup is called on the behaviors, they want to load the TPermissionsManager a second time rather than link to the existing permissions manager. The Behaviors shouldn't be including the manager as a sleep property.

Also, on waking up, it needs to relink to the Permissions Manager. Permissions Manager is a singleton and it should keep a self reference for producing the singleton.

belisoful commented 1 year ago

the main culprit is the TPermissionsConfigurationBehavior being restored with the manager being duplicated on unserialize.