Xataface
2.0alpha2
Xataface Application Framework
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
actions
ajax_get_permissions.php
Go to the documentation of this file.
1
<?php
2
class
dataface_actions_ajax_get_permissions
{
3
4
function
handle
($params){
5
6
session_write_close();
7
header(
'Connection:close'
);
8
9
$app
=
Dataface_Application::getInstance
();
10
$query =
$app
->getQuery();
11
12
if
( @$query[
'--id'
] ){
13
$table
=
Dataface_Table::loadTable
($query[
'-table'
]);
14
$keys
= array_keys(
$table
->keys());
15
if
( count(
$keys
) > 1 ){
16
throw
new
Exception(
"Table has compound key so its permissions cannot be retrieved with the --id parameter."
);
17
}
18
$query[
$keys
[0]] =
'='
.$query[
'--id'
];
19
$record = df_get_record($query[
'-table'
], $query);
20
}
else
{
21
22
$record =
$app
->getRecord();
23
}
24
$perms = array();
25
if
( $record ) $perms = $record->getPermissions();
26
27
header(
'Content-type: application/json; charset="'
.
$app
->_conf[
'oe'
].
'"'
);
28
$out
= json_encode($perms);
29
header(
'Content-Length: '
.strlen(
$out
));
30
echo
$out
;
31
flush();
32
}
33
}
Generated on Fri Mar 22 2013 09:40:33 for Xataface by
1.8.1.2