mirror of
https://github.com/flarum/core.git
synced 2025-07-15 22:06:24 +02:00
Fix permission check in edit modal
Previously was checking ability to edit own user instead of user selected in modal
This commit is contained in:
committed by
Daniël Klabbers
parent
186e8be026
commit
dba6ad9d57
@ -61,7 +61,7 @@ export default class EditUserModal<CustomAttrs extends IEditUserModalAttrs = IEd
|
|||||||
fields() {
|
fields() {
|
||||||
const items = new ItemList();
|
const items = new ItemList();
|
||||||
|
|
||||||
if (app.session.user?.canEditCredentials()) {
|
if (this.attrs.user.canEditCredentials()) {
|
||||||
items.add(
|
items.add(
|
||||||
'username',
|
'username',
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
@ -145,7 +145,7 @@ export default class EditUserModal<CustomAttrs extends IEditUserModalAttrs = IEd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (app.session.user?.canEditGroups()) {
|
if (this.attrs.user.canEditGroups()) {
|
||||||
items.add(
|
items.add(
|
||||||
'groups',
|
'groups',
|
||||||
<div className="Form-group EditUserModal-groups">
|
<div className="Form-group EditUserModal-groups">
|
||||||
|
Reference in New Issue
Block a user