summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-12-15 12:24:31 +0100 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-12-15 12:24:31 +0100 |
commit | 2c3aa52b642858b85ba756df927ff5730f5ee73d (patch) | |
tree | 2273f5eb7b9dce79bb0833714cd390e2f3e01113 /src/special | |
parent | 7184f076617493b29ddaf4413ab58d14bba4b9d4 (diff) |
...
Diffstat (limited to 'src/special')
-rw-r--r-- | src/special/spe_map.erl | 6 | ||||
-rw-r--r-- | src/special/spe_player.erl | 27 |
2 files changed, 24 insertions, 9 deletions
diff --git a/src/special/spe_map.erl b/src/special/spe_map.erl index 1de946b..dbd6c3e 100644 --- a/src/special/spe_map.erl +++ b/src/special/spe_map.erl @@ -24,15 +24,15 @@ grant_additional (OwnerID) -> ataxia_client:add ( map_db, - ataxia_security:any(), - [ataxia_security:user_from_id(OwnerID)], + ataxia_security:only_allow(ataxia_security:any()), + ataxia_security:only_allow(ataxia_security:user_from_id(OwnerID)), Map ), MapSummary = shr_map_summary:new(MapID, <<"Untitled Map">>), PlayerUpdateQueryOp = - ataxic:value + ataxic:update_value ( ataxic:update_field ( diff --git a/src/special/spe_player.erl b/src/special/spe_player.erl index 4b9a80a..65c651c 100644 --- a/src/special/spe_player.erl +++ b/src/special/spe_player.erl @@ -98,12 +98,15 @@ generate (Username, Password, Email) -> Player = shr_player:new(<<"">>, Username, Password, Email), + JanitorOnlyPermission = + ataxia_security:allow_only(ataxia_security:janitor()), + {ok, PlayerID} = ataxia_client:add ( player_db, - ataxia_security:janitor(), - ataxia_security:janitor(), + JanitorOnlyPermission, + JanitorOnlyPermission, Player ), @@ -116,7 +119,7 @@ generate (Username, Password, Email) -> ataxic:sequence_meta ( [ - ataxic:value + ataxic:update_value ( ataxic:sequence ( @@ -139,10 +142,22 @@ generate (Username, Password, Email) -> ] ) ), - ataxic:read_permission(ataxic:constant(ataxia_security:any())), - ataxic:write_permission + ataxic:update_read_permission ( - ataxic:constant([ataxia_security:user_from_id(PlayerID)]) + ataxic:constant + ( + ataxia_security:allow_only(ataxia_security:any()) + ) + ), + ataxic:update_write_permission + ( + ataxic:constant + ( + ataxia_security:allow_only + ( + ataxia_security:user_from_id(PlayerID) + ) + ) ) ] ), |