Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
18edf533
Commit
18edf533
authored
Jul 09, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testGUIwithSecurity: test display of restricted properties
parent
eefaa8b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
product/ERP5Form/tests/testGUIwithSecurity.py
product/ERP5Form/tests/testGUIwithSecurity.py
+16
-1
No files found.
product/ERP5Form/tests/testGUIwithSecurity.py
View file @
18edf533
...
...
@@ -60,7 +60,7 @@ class TestGUISecurity(ERP5TypeTestCase):
def
stepCreateTestFoo
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
foo_module
=
self
.
portal
.
foo_module
foo_module
.
newContent
(
portal_type
=
'Foo'
,
id
=
'foo'
,
foo_category
=
'a'
)
foo_module
.
newContent
(
portal_type
=
'Foo'
,
id
=
'foo'
,
foo_category
=
'a'
,
protected_property
=
'Protected Property'
)
# allow Member to view foo_module in a hard coded way as it is not required to setup complex
# security for this test (by default only 5A roles + Manager can view default modules)
for
permission
in
(
'Access contents information'
,
'View'
):
...
...
@@ -147,3 +147,18 @@ class TestGUISecurity(ERP5TypeTestCase):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_read_permission_property
(
self
):
"""
This test checks that property defined with a `read_property` that the
logged in user does not have are not displayed.
"""
self
.
login
()
# as manager
self
.
stepCreateObjects
()
self
.
stepCreateTestFoo
()
protected_property_markup
=
'<input name="field_my_protected_property" value="Protected Property" type="text"'
self
.
assertIn
(
protected_property_markup
,
self
.
portal
.
foo_module
.
foo
.
Foo_viewSecurity
())
self
.
loginAs
()
# user without permission to access protected property
self
.
assertNotIn
(
protected_property_markup
,
self
.
portal
.
foo_module
.
foo
.
Foo_viewSecurity
())
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