Ghost/core/server/models
Gabor Javorszky 80f9023020 Added /roles/ API endpoint
Closes #3196

* adds `/roles/` endpoint
* is given the current user as context
* wraps everything in a canthis.browse.role
* gets all the available roles (should "Owner" be filtered out?)
* optional parameter: `permission=assign`. Gets all roles authenticated user could assign
* if we're not signed in, gives a "please sign in" (standard) error
* if we're signed in, but user is not in the context, gives a "there was no user in the context" error
* if the user is an "Author", gives a "there are no available roles to assign" error
* implemented hacky filter because when.js produces heisenbugs past 3.2.3 (when.filter not available)
* added extra fixtures to `permissions.json`. Might need a migration.

Caveats:

* there are no tests
* for some reason the setup functional test was failing for me locally
2014-07-21 15:02:25 +01:00
..
accesstoken.js Server side cleanup 2014-07-14 21:50:12 +01:00
app.js Use bookshelf's model registry plugin 2014-07-13 18:18:25 +01:00
appField.js Use bookshelf's model registry plugin 2014-07-13 18:18:25 +01:00
appSetting.js Use bookshelf's model registry plugin 2014-07-13 18:18:25 +01:00
base.js Export 003 2014-07-19 22:38:21 +01:00
basetoken.js Server side cleanup 2014-07-14 21:50:12 +01:00
client.js Extending context concept to models 2014-07-18 15:32:56 +01:00
index.js Server side cleanup 2014-07-14 21:50:12 +01:00
permission.js Extending context concept to models 2014-07-18 15:32:56 +01:00
post.js Model & test cleanup 2014-07-20 09:34:30 +01:00
refreshtoken.js Server side cleanup 2014-07-14 21:50:12 +01:00
role.js Added /roles/ API endpoint 2014-07-21 15:02:25 +01:00
settings.js Extending context concept to models 2014-07-18 15:32:56 +01:00
tag.js Extending context concept to models 2014-07-18 15:32:56 +01:00
user.js Larger default gravatar images 2014-07-20 18:50:07 +02:00