File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -1221,19 +1221,15 @@ def describe(self, input):
12211221 @Routing .route ("/data" )
12221222 @_data_decorator
12231223 def data (self , input ):
1224- """Describe the sublements of data
1224+ """Describe the subelements of data
12251225
1226- FIXME: should have a key for every element under data in
1227- the schema the user can access.
1228- This is just an example.
1226+ One entry for each class the user may view
12291227 """
1230- result = {
1231- "issue" : { "link" : self .base_path + "/data/" + "issue" },
1232- "status" : { "link" : self .base_path + "/data/" + "status" },
1233- "keyword" : { "link" : self .base_path + "/data/" + "keyword" },
1234- "user" : { "link" : self .base_path + "/data/" + "user" }
1235- }
1236-
1228+ result = {}
1229+ uid = self .db .getuid ()
1230+ for cls in sorted (self .db .classes ) :
1231+ if self .db .security .hasPermission ('View' , uid , cls ) :
1232+ result [cls ] = dict (link = self .base_path + '/data/' + cls )
12371233 return 200 , result
12381234
12391235 @Routing .route ("/summary" )
You can’t perform that action at this time.
0 commit comments