silverstripe / silverstripe-session-manager

Allow users to manage and revoke access to multiple login sessions across devices.
BSD 3-Clause "New" or "Revised" License
9 stars 7 forks source link

Unable to revoke non-admin users #67

Closed emteknetnz closed 3 years ago

emteknetnz commented 3 years ago

Non-admin user isn't able to revoke their own sessions.

With a test user in the group "Content authors", when attempting to revoke a session I see a red toast "Could not log out of session. Try again later"

Originally noted on this pull-request https://github.com/silverstripe/silverstripe-session-manager/pull/62#issuecomment-823742134

ACs

Pull request

maxime-rainville commented 3 years ago

I've updated the ACs

I spent some time trying to solve this through #62. There's a couple thoughts:

In short, this is an example of how cutting corners and not following best practices does not actually save you time in the long run.

emteknetnz commented 3 years ago

My preference is do it all and refactor the whole thing to make it more proper. And of course there's no sane argument against "Do it right first time"

I'm just not sure the time investment is worth it at this stage in the project though? Seems like the refactor itself could easily add several days once peer-review and testing is taken into consideration?

Other than "code less bad" what's the long term benefit here? There's no plan at this stage to develop or extend this module any further beyond this project.

Seems like MVP here is:

?

maxime-rainville commented 3 years ago

Obviously, I don't know that if we don't refactor this bit of the system, some horrible calamity will befall us. It's totally possible - even probable - that we could get away with the suggested MVP and never have to look at this bit of code ever again.

But it's worth pointing out that this refactor is relatively cheap right now:

If we ship this like this in version 1.0.0, we're stuck keeping it like this forever.

On a side note that's probably more relevant for a post-project retro, there seems to have been very little planning around the architecture of this module or review of the pre-existing implementation. I would argue that this led to a lot of those late critical issues:

emteknetnz commented 3 years ago

Cucumber test looks good