@@ -35,6 +35,12 @@ export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, Paginat
                 });
             }
 
+            // we need to load the roles into ember cache
+            // invites return role_id only and we do not offer a /role/:id endpoint
+            modelPromises.roles = this.get('store').query('role', {permissions: 'assign'}).then((roles) => {
+                return roles;
+            });
+
             return RSVP.hash(modelPromises);
         });
     },
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
import PaginationMixin from 'ghost-admin/mixins/pagination';
import styleBody from 'ghost-admin/mixins/style-body';
import RSVP from 'rsvp';
import {isBlank} from 'ember-utils';

export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, PaginationMixin, {
    titleToken: 'Team',

    classNames: ['view-team'],

    paginationModel: 'user',
    paginationSettings: {
        status: 'all',
        limit: 20
    },

    model() {
        return this.get('session.user').then((user) => {
            let modelPromises = {
                users: this.loadFirstPage().then(() => {
                    return this.store.filter('user', (user) => {
                        return !user.get('isNew') && !isBlank(user.get('status'));
                    });
                })
            };

            // authors do not have permission to hit the invites endpoint
            if (!user.get('isAuthor')) {
                modelPromises.invites = this.store.query('invite', {limit: 'all'}).then(() => {
                    return this.store.filter('invite', (invite) => {
                        return !invite.get('isNew');
                    });
                });
            }

            return RSVP.hash(modelPromises);
        });
    },

    setupController(controller, models) {
        controller.setProperties(models);
    },

    actions: {
        reload() {
            this.refresh();
        }
    }
});

Is the `{permissions: 'assign'}` needed here? It would be preferable to load all roles so that the role of team members can be displayed even if the current user doesn't have permission to assign those roles to new users.