Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
a44ae976
Commit
a44ae976
authored
Mar 11, 2016
by
matejcik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
limit project-level actions to project-specific groupACLs
parent
b1c4d0b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
docs/admin/access.rst
docs/admin/access.rst
+4
-0
weblate/trans/permissions.py
weblate/trans/permissions.py
+3
-1
weblate/trans/tests/test_permissions.py
weblate/trans/tests/test_permissions.py
+23
-0
No files found.
docs/admin/access.rst
View file @
a44ae976
...
...
@@ -203,6 +203,10 @@ will have privileges on the component, and members of the
project-and-language-specific groups will not. The latter will, of course, have
privileges on their language in all other components of the project.
For project-level actions (such as pushing upstream, setting priority, etc.),
you must create a group ACL locked to *only* the project. Combinations, such
as project plus language, only apply to actions on individual translations.
Managing users and groups
-------------------------
...
...
weblate/trans/permissions.py
View file @
a44ae976
...
...
@@ -54,7 +54,9 @@ def has_group_perm(user, permission, translation=None, project=None):
Q
(
subproject
=
translation
.
subproject
)
))
elif
project
is
not
None
:
acls
=
list
(
GroupACL
.
objects
.
filter
(
project
=
project
))
acls
=
list
(
GroupACL
.
objects
.
filter
(
project
=
project
,
subproject
=
None
,
language
=
None
))
else
:
return
False
...
...
weblate/trans/tests/test_permissions.py
View file @
a44ae976
...
...
@@ -248,3 +248,26 @@ class GroupACLTest(ModelTestCase):
self
.
assertTrue
(
can_edit
(
self
.
privileged
,
trans_cs
,
perm_name
))
self
.
assertFalse
(
can_edit
(
self
.
privileged
,
trans_de
,
perm_name
))
def
test_project_specific
(
self
):
permission
=
Permission
.
objects
.
get
(
codename
=
'author_translation'
,
content_type__app_label
=
'trans'
)
self
.
group
.
permissions
.
add
(
permission
)
acl_project_lang
=
GroupACL
.
objects
.
create
(
language
=
self
.
language
,
project
=
self
.
project
)
acl_project_lang
.
groups
.
add
(
self
.
group
)
self
.
assertFalse
(
check_permission
(
self
.
privileged
,
self
.
project
,
'trans.author_translation'
))
acl_project_only
=
GroupACL
.
objects
.
create
(
project
=
self
.
project
)
acl_project_only
.
groups
.
add
(
self
.
group
)
self
.
assertTrue
(
check_permission
(
self
.
privileged
,
self
.
project
,
'trans.author_translation'
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment