Roughing in user admin
This commit is contained in:
parent
3b3f8cc691
commit
be8a842c67
5 changed files with 23 additions and 1 deletions
|
@ -7,5 +7,9 @@ export default DS.Model.extend({
|
|||
role : DS.attr('string'),
|
||||
createdAt: DS.attr('date'),
|
||||
updatedAt: DS.attr('date'),
|
||||
deletedAt: DS.attr('date')
|
||||
deletedAt: DS.attr('date'),
|
||||
|
||||
isAdmin: function() {
|
||||
return this.get('role') === 'A';
|
||||
}.property('role'),
|
||||
});
|
||||
|
|
|
@ -14,6 +14,11 @@
|
|||
{{#link-to 'protected.characteristics' tagName='li' href=false}}
|
||||
{{link-to 'Characteristics' 'protected.characteristics'}}
|
||||
{{/link-to}}
|
||||
{{#if session.currentUser.isAdmin}}
|
||||
{{#link-to 'protected.users' tagName='li' href=false}}
|
||||
{{link-to 'Users' 'protected.users'}}
|
||||
{{/link-to}}
|
||||
{{/if}}
|
||||
{{#link-to 'protected.about' tagName='li' href=false}}
|
||||
{{link-to 'About' 'protected.about'}}
|
||||
{{/link-to}}
|
||||
|
|
8
app/pods/protected/users/index/route.js
Normal file
8
app/pods/protected/users/index/route.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
model: function() {
|
||||
return this.store.findAll('user');
|
||||
},
|
||||
|
||||
});
|
3
app/pods/protected/users/index/template.hbs
Normal file
3
app/pods/protected/users/index/template.hbs
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{#each model as |user|}}
|
||||
{{user.email}}<br>
|
||||
{{/each}}
|
|
@ -19,6 +19,8 @@ Router.map(function() {
|
|||
this.route('protected', { path: '/' }, function() {
|
||||
this.route('about');
|
||||
|
||||
this.route('users');
|
||||
|
||||
this.route('compare', function() {
|
||||
this.route('results');
|
||||
});
|
||||
|
|
Reference in a new issue