-
Notifications
You must be signed in to change notification settings - Fork 7
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
Sessions should only be visible by owning user #57
Comments
This code in // Members can manage their own sessions
if ($this->ID == $member->ID) {
return true;
}
// Access to SecurityAdmin implies session management permissions
return Permission::checkMember($member, 'CMS_ACCESS_SecurityAdmin'); to // Members can manage their own sessions
if ($this->MemberID === $member->ID) {
return true;
}
return false; |
Probably worth updating following code in $id = $request->param('ID');
$loginSession = LoginSession::get()->byID($id); to $id = $request->param('ID');
$memberID = Security::getCurrentUser()->ID;
$loginSession = LoginSession::get()->filter(['ID' => $id, 'MemberID' => $memberID])->first(); |
The current permission model is poorly implemented.
Here's what I want to do:
|
Looks good
How do you see this working? |
You would stick an extension on Maybe you use a pre-existing permission to decide if the user can delete the login session. Maybe you just check if the current user can edit the member. Maybe you implement your own permission provider. Ultimately, that's a decision the developer has to make for themselves. We've got a follow up issue to explore this in further detail #57 (comment) |
I've made a suggestion in #63 that we should recommend that if the behaviour is altered, the privileged user should get both CanView and CanDelete actions (given there's no read-only view). |
Linked PR has been merged Noted on the pull request there's an issue with non-admin users revoking sessions. We've agreed to split that of as a separate issue. #67 |
Overview
A user should be the only one who can view and manage existing sessions.
Currently with this module installed, a user who has access to view other member profiles (like the default Administrator role) has the ability to view and manage their sessions. This shouldn't be the case.
Acceptance Criteria
Pull request
The text was updated successfully, but these errors were encountered: