Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
synnefo
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
synnefo
Commits
c24ac658
Commit
c24ac658
authored
12 years ago
by
Georgios D. Tsoukalas
Browse files
Options
Downloads
Patches
Plain Diff
minor refactor object_list for clarity
parent
6b75d4bf
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
snf-pithos-app/pithos/api/functions.py
+14
-11
14 additions, 11 deletions
snf-pithos-app/pithos/api/functions.py
with
14 additions
and
11 deletions
snf-pithos-app/pithos/api/functions.py
+
14
−
11
View file @
c24ac658
...
@@ -646,9 +646,9 @@ def object_list(request, v_account, v_container):
...
@@ -646,9 +646,9 @@ def object_list(request, v_account, v_container):
shared
=
False
shared
=
False
if
'
shared
'
in
request
.
GET
:
if
'
shared
'
in
request
.
GET
:
shared
=
True
shared
=
True
public
=
False
if
request
.
user_uniq
==
v_account
and
'
public
'
in
request
.
GET
:
public_requested
=
'
public
'
in
request
.
GET
public
=
True
public_granted
=
public_requested
and
request
.
user_uniq
==
v_account
if
request
.
serialization
==
'
text
'
:
if
request
.
serialization
==
'
text
'
:
try
:
try
:
...
@@ -656,7 +656,7 @@ def object_list(request, v_account, v_container):
...
@@ -656,7 +656,7 @@ def object_list(request, v_account, v_container):
request
.
user_uniq
,
v_account
,
request
.
user_uniq
,
v_account
,
v_container
,
prefix
,
delimiter
,
marker
,
v_container
,
prefix
,
delimiter
,
marker
,
limit
,
virtual
,
'
pithos
'
,
keys
,
shared
,
limit
,
virtual
,
'
pithos
'
,
keys
,
shared
,
until
,
None
,
public
)
until
,
None
,
public
_granted
)
except
NotAllowedError
:
except
NotAllowedError
:
raise
Forbidden
(
'
Not allowed
'
)
raise
Forbidden
(
'
Not allowed
'
)
except
ItemNotExists
:
except
ItemNotExists
:
...
@@ -674,7 +674,7 @@ def object_list(request, v_account, v_container):
...
@@ -674,7 +674,7 @@ def object_list(request, v_account, v_container):
objects
=
request
.
backend
.
list_object_meta
(
objects
=
request
.
backend
.
list_object_meta
(
request
.
user_uniq
,
v_account
,
request
.
user_uniq
,
v_account
,
v_container
,
prefix
,
delimiter
,
marker
,
v_container
,
prefix
,
delimiter
,
marker
,
limit
,
virtual
,
'
pithos
'
,
keys
,
shared
,
until
,
None
,
public
)
limit
,
virtual
,
'
pithos
'
,
keys
,
shared
,
until
,
None
,
public
_granted
)
object_permissions
=
{}
object_permissions
=
{}
object_public
=
{}
object_public
=
{}
if
until
is
None
:
if
until
is
None
:
...
@@ -690,8 +690,11 @@ def object_list(request, v_account, v_container):
...
@@ -690,8 +690,11 @@ def object_list(request, v_account, v_container):
object
=
x
[
name_idx
:]
object
=
x
[
name_idx
:]
object_permissions
[
object
]
=
request
.
backend
.
get_object_permissions
(
object_permissions
[
object
]
=
request
.
backend
.
get_object_permissions
(
request
.
user_uniq
,
v_account
,
v_container
,
object
)
request
.
user_uniq
,
v_account
,
v_container
,
object
)
for
k
,
v
in
request
.
backend
.
list_object_public
(
request
.
user_uniq
,
v_account
,
v_container
,
prefix
).
iteritems
():
if
public_granted
:
for
k
,
v
in
request
.
backend
.
list_object_public
(
request
.
user_uniq
,
v_account
,
v_container
,
prefix
).
iteritems
():
object_public
[
k
[
name_idx
:]]
=
v
object_public
[
k
[
name_idx
:]]
=
v
except
NotAllowedError
:
except
NotAllowedError
:
raise
Forbidden
(
'
Not allowed
'
)
raise
Forbidden
(
'
Not allowed
'
)
...
@@ -729,9 +732,9 @@ def object_list(request, v_account, v_container):
...
@@ -729,9 +732,9 @@ def object_list(request, v_account, v_container):
if
permissions
:
if
permissions
:
update_sharing_meta
(
request
,
permissions
,
v_account
,
update_sharing_meta
(
request
,
permissions
,
v_account
,
v_container
,
meta
[
'
name
'
],
meta
)
v_container
,
meta
[
'
name
'
],
meta
)
public
=
object_public
.
get
(
meta
[
'
name
'
],
None
)
public
_url
=
object_public
.
get
(
meta
[
'
name
'
],
None
)
if
public
and
request
.
user_uniq
==
v_account
:
if
public
_granted
:
update_public_meta
(
public
,
meta
)
update_public_meta
(
public
_url
,
meta
)
object_meta
.
append
(
printable_header_dict
(
meta
))
object_meta
.
append
(
printable_header_dict
(
meta
))
if
request
.
serialization
==
'
xml
'
:
if
request
.
serialization
==
'
xml
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment