0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-18 02:21:47 -05:00
ghost/core/server
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
..
api Added /roles/ API endpoint 2014-07-21 15:02:25 +01:00
apps correct settings.edit call signature for installedApps 2014-05-24 08:21:17 +02:00
config Move creation of knex instance to config module 2014-07-10 08:00:24 -04:00
controllers Wire permmissions for notifications, mail and tags 2014-07-17 16:44:09 +01:00
data Added /roles/ API endpoint 2014-07-21 15:02:25 +01:00
errors Extending context concept to models 2014-07-18 15:32:56 +01:00
helpers Turn on update notifications for Ember admin 2014-07-11 15:02:26 +00:00
middleware Merge pull request #3312 from ErisDS/issue-2739-2 2014-07-17 18:04:38 +01:00
models Added /roles/ API endpoint 2014-07-21 15:02:25 +01:00
permissions Only reference model properties through the models module. 2014-07-10 08:04:32 -04:00
routes Added /roles/ API endpoint 2014-07-21 15:02:25 +01:00
storage Move image upload to API 2014-07-15 12:40:14 +02:00
utils Export 003 2014-07-19 22:38:21 +01:00
views Prevent loading setup screen if already setup 2014-07-16 15:54:42 +00:00
api.js Shims for deleted (refactored away) files 2014-01-09 09:21:09 -06:00
filters.js Implement filter context 2014-04-06 15:43:11 +00:00
index.js Wire permmissions for notifications, mail and tags 2014-07-17 16:44:09 +01:00
mail.js Update when.js dependency to version 3.2.3 2014-06-16 04:11:22 +00:00
middleware.js Shims for deleted (refactored away) files 2014-01-09 09:21:09 -06:00
require-tree.js Error handling for require-tree 2014-03-25 22:38:48 +00:00
update-check.js Extending context concept to models 2014-07-18 15:32:56 +01:00
xmlrpc.js Add distinct error classes 2014-05-09 12:11:29 +02:00