Skip to content

Replace GroupACL with something more reasonable [$50 awarded] #1798

@nijel

Description

@nijel

While the GroupACL is certainly better than having just group based access Django provides, it turns out to be pretty hard to configure properly due to permission filtering and layering of GroupACLs. Also the logic to evaluate this is unnecessarily complex.

Summary of this is available in the wiki: https://github.com/WeblateOrg/weblate/wiki/Access-control-design

Problems with current GroupACL:

  • Unclear layering of them, it's pretty much coded here, but ordering within same group is pretty much random:

# more specific rules are more important:
# subproject > project > language
acls.sort(reverse=True, key=lambda a: (
a.subproject is not None,
a.project is not None,
a.language is not None))
for acl in acls:
groupacls.append((
acl.groups.all() & user.groups.all(),
acl.permissions.values_list('id', flat=True)
))

  • The idea of permissions filtering is usually to complex to setup
  • Exposing all permissions in the admin interface adds unnecessary complexity as most of the automatically generated Django permissions are not used
  • The can_access permission can not be used with per language ACL as it's only applied to the translation (leading to confusing situations that user can not access /project/foo/ but can access /project/foo/bar/cs/)
  • The project and language ACL does not seem to work (this might be just bug in the current implementation)

We probably should focus on creating something simple which will cover most of the use cases and then potentially extend it.

What we need from the access control system:

  • Define access to individual projects, translations or languages (not sure about components)
  • Granular permissions (access project, translate, suggest, review, ...)
  • Interface to edit per project groups directly in Weblate
  • Automatic adding of users to groups

What can be probably omitted from current feature:

  • Restrict access by additional rules (currently GroupACL can be used to revoke permissions)
  • Defining permissions for individual users, having groups is good enough in most cases

Following use cases should work (some of them might be duplicate, but that's real world situations I've met so far):

  • Grant every user translation permission to a project
  • Grant project visibility to group only
  • Grant group review permission to a language in all projects
  • Grant group translation permission to a language in all projects
  • Grant group translation permission to a language in single project
  • Grant admin access to a project to a group

Bountysource

Metadata

Metadata

Assignees

Labels

enhancementAdding or requesting a new feature.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions