0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/core/server/data
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
..
export Export 003 2014-07-19 22:38:21 +01:00
fixtures Added /roles/ API endpoint 2014-07-21 15:02:25 +01:00
import Extending context concept to models 2014-07-18 15:32:56 +01:00
migration Export 003 2014-07-19 22:38:21 +01:00
utils Caching db config in migration utils 2014-07-21 13:25:53 +01:00
validation Fix validations on user settings page 2014-07-14 18:12:57 +00:00
versioning Only reference model properties through the models module. 2014-07-10 08:04:32 -04:00
default-settings.json Add app permission checking to canThis 2014-04-16 18:06:39 +02:00
schema.js switched parent_id for parent 2014-07-20 16:39:56 +01:00