#8044 API for current site notification


Expose the current site notification (i.e. ThemeProvider.get_site_notification logic) as an API.

The request.cookies might be able to stay as it is, but likely should support those values being passed in as regular API params. The response.set_cookie probably should be returned as response values.

Make sure the RAML api docs are updated.


  • Igor Bondarenko - 2016-01-17
    • labels: api, sf-current, sf-2 --> api, sf-current, sf-2, 42cc
    • status: open --> in-progress
    • assigned_to: Igor Bondarenko
  • Denis Kotov - 2016-01-21

    How to deal with authorization? Can anonymous get the notification for any other user? Or just authorized user? Or should the user have any specific rights?

    • Dave Brondsema

      Dave Brondsema - 2016-01-21

      Standard rest API authorization should work fine. (It lets oauth or current user session work).

      For access/rights, it should be just for the current user.

  • Denis Kotov - 2016-01-22
    • status: in-progress --> review
  • Dave Brondsema

    Dave Brondsema - 2016-01-22
    • status: review --> in-progress
    • Reviewer: Dave Brondsema
  • Dave Brondsema

    Dave Brondsema - 2016-01-22

    Hi Denis,

    This is looking pretty good, but some small improvements can be made:

    • It'd be useful to have an optional parameter for "url" so that the URL regex logic can take effect.
    • Other APIs also work without oauth, if you are currently logged in. That's quite convenient. It works because they use c.user. Can we set this one up the same way? By the way, it is nice for more "core" methods, e.g. _get_site_notification to have things like user passed in instead of using the globals. So don't change that, just pass c.api_token.user / c.user in as an argument.
    • I think that can also help clean up the two _get_site_notification calls which are very similar. It'd be nicer if it could be just one call (always passing in some user object).
    • In the .raml can you move the new section to the very end? It's not as important as the all the other tools, so better to have it show up last instead of first.
  • Denis Kotov - 2016-01-26
    • status: in-progress --> review
  • Dave Brondsema

    Dave Brondsema - 2016-01-27
    • status: review --> closed
  • Dave Brondsema

    Dave Brondsema - 2016-04-11
    • Milestone: unreleased --> v1.4.0

Log in to post a comment.