0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-18 02:21:47 -05:00
ghost/core
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
..
client Adding helper for invite status 2014-07-20 09:23:57 +01:00
server Added /roles/ API endpoint 2014-07-21 15:02:25 +01:00
shared Implement Mobile Editor 2014-06-24 18:33:43 -04:00
test Fix tests tripping spam protection 2014-07-21 14:33:42 +01:00
bootstrap.js Improve error handling during bootstrap process 2014-06-19 12:59:16 +00:00
index.js Improve error handling during bootstrap process 2014-06-19 12:59:16 +00:00
server.js Shims for deleted (refactored away) files 2014-01-09 09:21:09 -06:00