Add a way to refine shortcuts

- Add a field `allowed_groups` to shortcuts, which will contain groups which can
  access a particular app
- When a user is logged in, only return those shortcuts to the front page if the
  user is allowed to access them. This check is done based on the allowed_groups
  field of the shortcut
- Add allowed_groups for shortcuts of all apps with group-restricted access

Signed-off-by: Hemanth Kumar Veeranki <hemanthveeranki@gmail.com>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
Hemanth Kumar Veeranki authored and Joseph Nuthalapati committed 2018-06-21 18:53:45 +05:30
1 parent eb0acca0f8
commit b605c9da8a
9 files changed
+45 -17

No files matched your search

+2 -1
View File
@@ -101,7 +101,8 @@ def setup(helper, old_version=None):
def add_shortcut():
"""Add a shortcut to the front page."""
frontpage.add_shortcut('ttrss', name, short_description=short_description,
url='/tt-rss', login_required=True)
url='/tt-rss', login_required=True,
allowed_groups=[group[0]])
def is_enabled():