考虑这些模型:
用户
export default DS.Model.extend({
name: DS.attr('string'),
groups: DS.hasMany('group'),
permissions: Ember.computed('groups.@each.permissions.[]', groups => {
// What to do here?
})
});
组
export default DS.Model.extend({
name: DS.attr('string'),
permissions: DS.hasMany('permission')
});
权限
export default DS.Model.extend({
name: DS.attr('string')
});
如何在permissions
上获得包含所有User
Permissions
的所有Groups
的{{1}}媒体资源?