Ghost/ghost/admin/app/helpers/gh-user-can-admin.js
cobbspur acb1cc6283 Change permissions for team area
closes #5434

- remove transition away from team page to user page of authors
- hide invite button from authors
- hide invited users from authors
- adjusted gh-user-can and renamed to gh-user-can-admin
- hide password reset on owners profile from administrators
- hide input field for owner email from administrators pending api fix
- fix up tests
2015-07-03 20:06:45 +01:00

12 lines
476 B
JavaScript

import Ember from 'ember';
// Handlebars Helper {{gh-user-can-admin}} group users by admin and owner using if, or group them author using unless
// Usage: call helper as with aparameter of session.user
// e.g - {{#if (gh-user-can-admin session.user)}} 'block content' {{/if}}
// @param session.user
export function ghUserCanAdmin(params) {
return !!(params[0].get('isOwner') || params[0].get('isAdmin'));
}
export default Ember.HTMLBars.makeBoundHelper(ghUserCanAdmin);