0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00

Merge pull request #3356 from IanMitchell/header-role

Hide Settings Tab if Author
This commit is contained in:
Hannah Wolfe 2014-07-21 23:48:01 +01:00
commit 7f0c2b7782
2 changed files with 10 additions and 1 deletions

View file

@ -25,6 +25,13 @@ var User = DS.Model.extend(NProgressSaveMixin, ValidationEngine, {
updated_by: DS.belongsTo('user', { async: true }),
roles: DS.hasMany('role', { embedded: 'always' }),
// TODO: Once client-side permissions are in place,
// remove the hard role check.
isAuthor: Ember.computed('roles', function () {
return this.get('roles').objectAt(0).get('name').toLowerCase() === 'author';
}),
saveNewPassword: function () {
var url = this.get('ghostPaths.url').api('users', 'password');
return ic.ajax.request(url, {

View file

@ -6,7 +6,9 @@
<ul id="main-menu" >
{{gh-activating-list-item route="posts" title="Content" classNames="content js-close-sidebar"}}
{{gh-activating-list-item route="editor.new" title="New Post" classNames="editor js-close-sidebar"}}
{{gh-activating-list-item route="settings" title="Settings" classNames="settings js-close-sidebar"}}
{{#unless session.user.isAuthor}}
{{gh-activating-list-item route="settings" title="Settings" classNames="settings js-close-sidebar"}}
{{/unless}}
<li id="usermenu" class="usermenu subnav">
{{#gh-popover-button popoverName="user-menu" tagName="a" href="#" classNames="dropdown"}}