Basic example of accesscontrol nodes' implementation
A simple flow that grants and denies some permissions and checks these are actually recorded by the accesscontrol module, using the node-red-contrib-accesscontrol nodes.
Requirements
How to
Just press the inject button to initiate the flow, which displays the init, grant, extend, deny and permission nodes.
[{"id":"8cd608c01b89409f","type":"inject","z":"f9dfd849f78bbbe2","name":"Start","props":[{"p":"payload"},{"p":"role","v":"role","vt":"str"},{"p":"object","v":"object","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":90,"y":340,"wires":[["81fea6ddebceed92"]]},{"id":"faaebce9416797c8","type":"debug","z":"f9dfd849f78bbbe2","name":"Payload","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":680,"y":380,"wires":[]},{"id":"22c02588c95d5d3e","type":"debug","z":"f9dfd849f78bbbe2","name":"Attributes","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"attributes","targetType":"msg","statusVal":"","statusType":"auto","x":680,"y":420,"wires":[]},{"id":"0f0992dd3a6d4d2f","type":"function","z":"f9dfd849f78bbbe2","name":"","func":"msg.attr = [\"one\", \"two\", \"three\"];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":340,"wires":[["855defae8da134bf"]]},{"id":"81fea6ddebceed92","type":"AC init","z":"f9dfd849f78bbbe2","name":"","force":true,"check":true,"outputs":1,"x":210,"y":340,"wires":[["0f0992dd3a6d4d2f"]],"info":"Initialize the AccessControl module."},{"id":"e6bc146a8185c386","type":"delay","z":"f9dfd849f78bbbe2","name":"Wait","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":210,"y":440,"wires":[["015acd11701840dc"]]},{"id":"712adfe6fd314c53","type":"debug","z":"f9dfd849f78bbbe2","name":"Payload","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":680,"y":580,"wires":[]},{"id":"02ca2885cc12721d","type":"delay","z":"f9dfd849f78bbbe2","name":"Wait","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":210,"y":580,"wires":[["cea16af43dbb1ad0"]]},{"id":"2dfa12ba8eb2f6c4","type":"debug","z":"f9dfd849f78bbbe2","name":"Payload","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":680,"y":480,"wires":[]},{"id":"855defae8da134bf","type":"AC grant","z":"f9dfd849f78bbbe2","name":"","who":"role1","whoType":"str","createAny":"true","createAnyType":"bool","createOwn":"false","createOwnType":"bool","create":"attr","createType":"msg","readAny":"false","readAnyType":"bool","readOwn":"false","readOwnType":"bool","read":"","readType":"str","updateAny":"false","updateAnyType":"bool","updateOwn":"false","updateOwnType":"bool","update":"","updateType":"str","deleteAny":"false","deleteAnyType":"bool","deleteOwn":"false","deleteOwnType":"bool","delete":"","deleteType":"str","what":"res1","whatType":"str","x":350,"y":380,"wires":[["747a6bb058eac72e","e6bc146a8185c386"]]},{"id":"747a6bb058eac72e","type":"AC permission","z":"f9dfd849f78bbbe2","name":"","who":"role1","whoType":"str","crud":"create","any":true,"what":"res1","whatType":"str","x":530,"y":400,"wires":[["faaebce9416797c8","22c02588c95d5d3e"]]},{"id":"015acd11701840dc","type":"AC extend","z":"f9dfd849f78bbbe2","name":"","who":"role2","whoType":"str","what":"role1","whatType":"str","x":350,"y":480,"wires":[["590944d8d004da45"]]},{"id":"590944d8d004da45","type":"AC grant","z":"f9dfd849f78bbbe2","name":"","who":"role2","whoType":"str","createAny":"true","createAnyType":"bool","createOwn":"false","createOwnType":"bool","create":"","createType":"str","readAny":"false","readAnyType":"bool","readOwn":"false","readOwnType":"bool","read":"","readType":"str","updateAny":"false","updateAnyType":"bool","updateOwn":"false","updateOwnType":"bool","update":"","updateType":"str","deleteAny":"false","deleteAnyType":"bool","deleteOwn":"false","deleteOwnType":"bool","delete":"","deleteType":"str","what":"res2","whatType":"str","x":350,"y":520,"wires":[["a3716baf0f30efa6","02ca2885cc12721d","ee0d74372b0f8980"]]},{"id":"a3716baf0f30efa6","type":"AC permission","z":"f9dfd849f78bbbe2","name":"","who":"role2","whoType":"str","crud":"create","any":true,"what":"res2","whatType":"str","x":530,"y":580,"wires":[["712adfe6fd314c53"]]},{"id":"cea16af43dbb1ad0","type":"AC deny","z":"f9dfd849f78bbbe2","name":"","who":"role2","whoType":"str","createAny":"true","createAnyType":"bool","createOwn":"false","createOwnType":"bool","readAny":"false","readAnyType":"bool","readOwn":"false","readOwnType":"bool","updateAny":"false","updateAnyType":"bool","updateOwn":"false","updateOwnType":"bool","deleteAny":"false","deleteAnyType":"bool","deleteOwn":"false","deleteOwnType":"bool","what":"res2","whatType":"str","x":350,"y":580,"wires":[["a3716baf0f30efa6"]]},{"id":"c12fb07a7d771582","type":"debug","z":"f9dfd849f78bbbe2","name":"Attributes","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"attributes","targetType":"msg","statusVal":"","statusType":"auto","x":680,"y":520,"wires":[]},{"id":"ee0d74372b0f8980","type":"AC permission","z":"f9dfd849f78bbbe2","name":"","who":"role2","whoType":"str","crud":"create","any":true,"what":"res1","whatType":"str","x":530,"y":500,"wires":[["2dfa12ba8eb2f6c4","c12fb07a7d771582"]]}]