A document source that generates, maintains, or distributes electronic documents receives a policy that defines for an electronic document, a set of guidelines for access to the electronic document. Based on the policy, the document source generates a smart contract including a set of rules that when executed change a user's access rights with respect to the document and publishes the smart contract to a blockchain. An oracle is triggered to input a user request related to an electronic document to the smart contract. Based on execution of at least one of the rules, the document source receives an indication of an access right for the user and enforces the access right with respect to the electronic document.