mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
users: Add component for managing users and groups
- Handle groups needed by an app.
- Handle reserved usernames for an app.
- Updated documentation
- Updated unit tests
Tests performed:
- Reserved usernames: ez-ipupd, ejabberd, Debian-minetest, mldonkey,
monkeysphere, mumble-server, privoxy, quasselcore, radicale, debian-tor,
debian-transmission
- Reserved usernames checks should work in the following forms:
- Create user
- Update user
- First boot user creation
- Full list of available groups should appear in following cases:
- Create user form
- Update user form
- Full list of groups should get created in Django DB during:
- Update user form display
- First boot form save
- When updating the last admin user, the 'admin' group choice is checked
and disabled.
- Following groups show up (sorted by group name):
- bit-torrent: Download files using BitTorrent applications
- git-access: Read-write access to Git repositories
- i2p: Manage I2P application
- wiki: View and edit wiki applications
- minidlna: Media streaming server
- ed2k: Download files using eDonkey applications
- freedombox-share: Access to the private shares
- web-search: Search the web
- syncthing: Administer Syncthing application
- feed-reader: Read and subscribe to news feeds
- admin: Access to all services and system settings
- Directory validation form checks for write permissions for following apps:
- deluge with debian-deluged user
- transmission with debian-transmission user
- Sharing app should show all the groups in add/edit share forms
- The following apps should get added to share group during setup:
debian-transmission
debian-deluged
- Unit tests pass
- Functional tests for users and groups pass
- Test that an app (example syncthing) provides the necessary
permissions to users in that group (but not in admin group).
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Fix i18n of group descriptions]
[sunil: Update developer documentation]
[sunil: Separate out cosmetic changes]
[sunil: Fix component ID for mumble]
[sunil: sharing: Remove unneeded dependency on users app]
[sunil: Implement better API for getting groups in component]
[sunil: Fix incorrect regression change ttrss app]
[sunil: Make iterating over gourps more readable]
[sunil: Improve tests, drop single use fixtures]
[sunil: Simplify test_view.py fixture]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
e6e67f7d53
commit
e04ae48637
30 files changed
+344
-166
No files matched your search
@@ -12,7 +12,7 @@ from plinth import cfg, frontpage, menu
|
||||
from plinth.daemon import Daemon
|
||||
from plinth.modules.apache.components import Webserver
|
||||
from plinth.modules.firewall.components import Firewall
|
||||
from plinth.modules.users import register_group
|
||||
from plinth.modules.users.components import UsersAndGroups
|
||||
from plinth.utils import Version, format_lazy
|
||||
|
||||
from .manifest import backup, clients # noqa, pylint: disable=unused-import
|
||||
@@ -39,8 +39,6 @@ _description = [
|
||||
'/tt-rss-app</a> for connecting.'))
|
||||
]
|
||||
|
||||
group = ('feed-reader', _('Read and subscribe to news feeds'))
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@@ -52,6 +50,9 @@ class TTRSSApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
|
||||
groups = {'feed-reader': _('Read and subscribe to news feeds')}
|
||||
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Tiny Tiny RSS'), icon_filename='ttrss',
|
||||
short_description=_('News Feed Reader'),
|
||||
@@ -69,7 +70,7 @@ class TTRSSApp(app_module.App):
|
||||
icon=info.icon_filename, url='/tt-rss',
|
||||
clients=info.clients,
|
||||
login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
allowed_groups=list(groups))
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-ttrss', info.name,
|
||||
@@ -83,6 +84,10 @@ class TTRSSApp(app_module.App):
|
||||
daemon = Daemon('daemon-ttrss', managed_services[0])
|
||||
self.add(daemon)
|
||||
|
||||
users_and_groups = UsersAndGroups('users-and-groups-ttrss',
|
||||
groups=groups)
|
||||
self.add(users_and_groups)
|
||||
|
||||
def enable(self):
|
||||
"""Enable components and API access."""
|
||||
super().enable()
|
||||
@@ -93,7 +98,6 @@ def init():
|
||||
"""Initialize the module."""
|
||||
global app
|
||||
app = TTRSSApp()
|
||||
register_group(group)
|
||||
|
||||
setup_helper = globals()['setup_helper']
|
||||
if setup_helper.get_state() != 'needs-setup' and app.is_enabled():
|
||||
|
||||
Reference in new issue
Block a user