mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 09:52:09 +03:00
3d6856614f
no issue - add ember-suave dependency - upgrade grunt-jscs dependency - add a new .jscsrc for the client's tests directory that extends from client's base .jscsrc - separate client tests in Gruntfile jscs task so they pick up the test's .jscsrc - standardize es6 usage across client
17 lines
527 B
JavaScript
17 lines
527 B
JavaScript
import Ember from 'ember';
|
|
|
|
const {Helper} = 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 Helper.helper(function (params) {
|
|
return ghUserCanAdmin(params);
|
|
});
|