mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 17:32:15 +03:00
983110d931
no issue - add eslint-plugin-ember, configure no-old-shims rule - run `eslint --fix` on `app`, `lib`, `mirage`, and `tests` to move imports to the new module imports - further cleanup of Ember globals usage - remove event-dispatcher initializer now that `canDispatchToEventManager` is deprecated
15 lines
516 B
JavaScript
15 lines
516 B
JavaScript
import {helper} from '@ember/component/helper';
|
|
|
|
// 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(function (params) {
|
|
return ghUserCanAdmin(params);
|
|
});
|