Skip to content

Commit d6160a1

Browse files
slightly tweak canShowOwn and use it where appropriate (#806)
1 parent 281a73b commit d6160a1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/abilities/user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class User extends Ability {
1414
}
1515

1616
get canShowOwn() {
17-
return this.session.isAuthenticated;
17+
return this.session.isAuthenticated && this.session.currentUser?.id;
1818
}
1919

2020
get canCreate() {

app/components/menu-sidebar.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<div class='profile-menu {{if layoutManager.profileMenuOpen "open"}}'>
3838
<MenuSidebarItem
3939
@link='users.user'
40-
@hasPermission={{can 'show individual users'}}
40+
@hasPermission={{can 'show own users'}}
4141
@icon='user'
4242
@title={{t 'mixin.menuItems.profile'}}
4343
@minor={{true}}

app/routes/profile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default class ProfileRoute extends AuthenticatedRoute {
55
@service router;
66

77
canAccess() {
8-
return this.abilities.can('show individual users');
8+
return this.abilities.can('show own users');
99
}
1010

1111
redirect() {

0 commit comments

Comments
 (0)