mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 15:12:58 +03:00
Merge pull request #3358 from IanMitchell/sidebar-role
Hide Settings Sidebar Based on Role
This commit is contained in:
commit
4eb03af0a3
@ -32,6 +32,12 @@ var User = DS.Model.extend(NProgressSaveMixin, ValidationEngine, {
|
||||
return this.get('roles').objectAt(0).get('name').toLowerCase() === 'author';
|
||||
}),
|
||||
|
||||
// TODO: Once client-side permissions are in place,
|
||||
// remove the hard role check.
|
||||
isEditor: Ember.computed('roles', function () {
|
||||
return this.get('roles').objectAt(0).get('name').toLowerCase() === 'editor';
|
||||
}),
|
||||
|
||||
saveNewPassword: function () {
|
||||
var url = this.get('ghostPaths.url').api('users', 'password');
|
||||
return ic.ajax.request(url, {
|
||||
|
@ -4,11 +4,19 @@
|
||||
</header>
|
||||
<nav class="settings-menu">
|
||||
<ul>
|
||||
{{gh-activating-list-item route="settings.general" title="General" classNames="general"}}
|
||||
{{gh-activating-list-item route="settings.users" title="Users" classNames="users"}}
|
||||
{{#if showApps}}
|
||||
{{gh-activating-list-item route="settings.apps" title="Apps" classNames="apps"}}
|
||||
{{/if}}
|
||||
{{#unless session.user.isAuthor}}
|
||||
{{#unless session.user.isEditor}}
|
||||
{{gh-activating-list-item route="settings.general" title="General" classNames="general"}}
|
||||
{{/unless}}
|
||||
|
||||
{{gh-activating-list-item route="settings.users" title="Users" classNames="users"}}
|
||||
|
||||
{{#if showApps}}
|
||||
{{#unless session.user.isEditor}}
|
||||
{{gh-activating-list-item route="settings.apps" title="Apps" classNames="apps"}}
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
</ul>
|
||||
</nav>
|
||||
</aside>
|
||||
|
Loading…
Reference in New Issue
Block a user