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
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
50ce2df1
Commit
50ce2df1
authored
Mar 20, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_hal_json_style: fix permission issue for appcache storage sync
- new parameter added for this scenario
parent
68170b7b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+4
-6
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
50ce2df1
...
...
@@ -67,6 +67,8 @@ from collections import OrderedDict
MARKER
=
[]
COUNT_LIMIT
=
1000
appcache
=
True
if
context
.
REQUEST
.
get
(
'appcache'
,
None
)
is
not
None
else
False
if
REQUEST
is
None
:
REQUEST
=
context
.
REQUEST
...
...
@@ -854,12 +856,10 @@ def renderForm(traversed_document, form, response_dict, key_prefix=None, selecti
action_to_call
=
"Base_callDialogMethod"
else
:
action_to_call
=
form
.
action
if
(
action_to_call
==
'Base_edit'
)
and
(
not
portal
.
portal_membership
.
checkPermission
(
'Modify portal content'
,
traversed_document
)):
if
(
not
appcache
)
and
(
action_to_call
==
'Base_edit'
)
and
(
not
portal
.
portal_membership
.
checkPermission
(
'Modify portal content'
,
traversed_document
)):
# prevent allowing editing if user doesn't have permission
include_action
=
False
# [HARDCODED] when adding hateoas script url to appcache, it fails due to lack of permissions
include_action
=
True
if
(
include_action
):
# Form action
response_dict
[
'_actions'
]
=
{
...
...
@@ -1212,9 +1212,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
'status'
:
statusLevelToString
(
portal_status_level
)
}
# [HARDCODED] when adding hateoas script url to appcache, it fails due to lack of permissions
if
False
:
#if (restricted == 1) and (portal.portal_membership.isAnonymousUser()):
if
(
not
appcache
)
and
(
restricted
==
1
)
and
(
portal
.
portal_membership
.
isAnonymousUser
()):
login_relative_url
=
site_root
.
getLayoutProperty
(
"configuration_login"
,
default
=
""
)
if
(
login_relative_url
):
response
.
setHeader
(
...
...
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