Skip to content

Commit a1f4472

Browse files
committed
Allow client to access read only/protected properties like creator,
actor, creation and creator. They can put @Protected=true (any capitalization on the value true) to the query string to get protected props.
1 parent b6727d2 commit a1f4472

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

roundup/rest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,14 +557,19 @@ def get_element(self, class_name, item_id, input):
557557
node = class_obj.getnode(item_id)
558558
etag = calculate_etag(node, class_name, item_id)
559559
props = None
560+
protected=False
560561
for form_field in input.value:
561562
key = form_field.name
562563
value = form_field.value
563564
if key == "fields":
564565
props = value.split(",")
566+
if key == "@protected":
567+
# allow client to request read only
568+
# properties like creator, activity etc.
569+
protected = value.lower() == "true"
565570

566571
if props is None:
567-
props = list(sorted(class_obj.properties.keys()))
572+
props = list(sorted(class_obj.getprops(protected=protected)))
568573

569574
try:
570575
result = [

0 commit comments

Comments
 (0)