2017-08-22 10:53:26 +03:00
|
|
|
import {helper} from '@ember/component/helper';
|
2015-10-28 14:36:45 +03:00
|
|
|
|
2015-06-30 16:21:03 +03:00
|
|
|
// 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) {
|
2019-01-22 19:25:14 +03:00
|
|
|
return !!(params[0].get('isOwnerOrAdmin'));
|
2015-06-30 16:21:03 +03:00
|
|
|
}
|
|
|
|
|
2016-06-30 13:21:47 +03:00
|
|
|
export default helper(function (params) {
|
2015-09-03 14:06:50 +03:00
|
|
|
return ghUserCanAdmin(params);
|
|
|
|
});
|