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":
AUL table

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,
       );
CommentFileSizeAuthor
Selection_006.png11.51 KBa.milkovsky

Comments

a.milkovsky’s picture

This tables structure will be released in AUL 2.x version. Previous structure will be saved in 1.x version

a.milkovsky’s picture

Status: Active » Fixed

Implemented 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.

a.milkovsky’s picture

Value column is not used as counted. It could be removed in future. But it will be a part of another issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

a.milkovsky’s picture

Assigned: a.milkovsky » Unassigned