Skip to content

Commit

Permalink
Add auth requirements to melody.
Browse files Browse the repository at this point in the history
  • Loading branch information
martindale committed Sep 29, 2015
1 parent 5d1ee25 commit c52f3ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/melody.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ var passport = new Passport({
resource: 'Person'
});

var Auth = require('maki-auth-simple');
var auth = new Auth({
resource: 'People'
});

melody.use(passport);
melody.use(auth);

var Post = melody.define('Post', {
auth: ['admin'],
attributes: {
title: { type: String , max: 240 , slug: true },
content: { type: String },
Expand All @@ -26,6 +33,7 @@ var Post = melody.define('Post', {
});

var Person = melody.define('Person', {
auth: ['admin'],
replicate: false,
icon: 'user',
attributes: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"homepage": "https://github.com/martindale/melody",
"dependencies": {
"maki": "git://github.com/martindale/maki",
"maki-auth-simple": "0.0.1",
"maki-passport-local": "0.0.4"
}
}

0 comments on commit c52f3ea

Please sign in to comment.