comparison app/model/Base.js @ 359:8bc067b5f9c5

Added helper function to get authorisation information for the current item.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Thu, 15 Aug 2013 14:03:47 +0200
parents 7f5f74e62658
children 08bb418f31c9
comparison
equal deleted inserted replaced
358:2b4ba307dae1 359:8bc067b5f9c5
10 * https://roundup-intern.intevation.de/bfs/issue30 10 * https://roundup-intern.intevation.de/bfs/issue30
11 * as some items can not be identified with a singe id. 11 * as some items can not be identified with a singe id.
12 */ 12 */
13 getEidi: function() { 13 getEidi: function() {
14 return "/" + idProperty; 14 return "/" + idProperty;
15 },
16 /**
17 * Helper function to make a AJAX request against the authinfo interface
18 * of the server
19 * @param callback function(model, readonly, isowner)
20 * @private
21 */
22 getAuthInfo: function(cb) {
23 Ext.Ajax.request({
24 scope: this,
25 url: 'server/rest/authinfo/' + this.data.probeId,
26 success: function(response, opts) {
27 var obj = Ext.decode(Ext.decode(response.responseText).data);
28 cb(this, obj.readonly, obj.isOwner);
29 },
30 failure: function(response, opts) {
31 console.log('server-side failure with status code ' + response.status);
32 cb(this, true, false);
33 }
34 });
15 } 35 }
16 }); 36 });

http://lada.wald.intevation.org