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
@@ -14,7 +14,7 @@ from plinth import frontpage, menu
|
||||
from plinth.errors import ActionError
|
||||
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 .forms import is_repo_url
|
||||
from .manifest import (GIT_REPO_PATH, # noqa, pylint: disable=unused-import
|
||||
@@ -36,8 +36,6 @@ _description = [
|
||||
'<a href="https://git-scm.com/docs/gittutorial">Git tutorial</a>.')
|
||||
]
|
||||
|
||||
group = ('git-access', _('Read-write access to Git repositories'))
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@@ -50,6 +48,8 @@ class GitwebApp(app_module.App):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
|
||||
groups = {'git-access': _('Read-write access to Git repositories')}
|
||||
|
||||
self.repos = []
|
||||
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
@@ -69,7 +69,7 @@ class GitwebApp(app_module.App):
|
||||
icon=info.icon_filename, url='/gitweb/',
|
||||
clients=info.clients,
|
||||
login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
allowed_groups=list(groups))
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-gitweb', info.name,
|
||||
@@ -84,6 +84,10 @@ class GitwebApp(app_module.App):
|
||||
'gitweb-freedombox-auth')
|
||||
self.add(self.auth_webserver)
|
||||
|
||||
users_and_groups = UsersAndGroups('users-and-groups-gitweb',
|
||||
groups=groups)
|
||||
self.add(users_and_groups)
|
||||
|
||||
def set_shortcut_login_required(self, login_required):
|
||||
"""Change the login_required property of shortcut."""
|
||||
shortcut = self.remove('shortcut-gitweb')
|
||||
@@ -163,7 +167,6 @@ def init():
|
||||
"""Initialize the module."""
|
||||
global app
|
||||
app = GitwebApp()
|
||||
register_group(group)
|
||||
|
||||
setup_helper = globals()['setup_helper']
|
||||
if setup_helper.get_state() != 'needs-setup':
|
||||
|
||||
Reference in new issue
Block a user