Currently for each combination of user + operation + nid we store separate record in DB in three tables: aul, aul_user, aul_node.
We can have only one table "aul":

To create realm name we need:
realm = {op}_{key}_{key_id}
Query for function aul_node_grants($account, $op):
SELECT gid
FROM aul
WHERE key = 'uid', op = $op, amount > 0, key_id = $uid
Query for function aul_node_access_records($node):
SELECT *
FROM aul
WHERE nid = $nid, amount > 0
$grants[] = array(
'realm' => {op}_{key}_{key_id},
'gid' => 2,
'grant_view' => 'value',
'grant_update' => 0,
'grant_delete' => 0,
);
Comments
Comment #1
a.milkovskyThis tables structure will be released in AUL 2.x version. Previous structure will be saved in 1.x version
Comment #2
a.milkovskyImplemented in the 2.x. branch.
Also aul_relations table is added in aul_relations module with fields: gid, source_nid.
It's table for handling of grants dependencies.
Comment #3
a.milkovskyValue column is not used as counted. It could be removed in future. But it will be a part of another issue.
Comment #5
a.milkovsky