User Permissions
Once the application is integrated with the Unity SDK, the next step is to onboard the organization’s data onto the network.
Whenever a user brings new data into the application, permissions will be asked to add this data to the network
Once the user gives the permission, the integrated SDK will store the permissions on-chain.
The permissions stored on-chain can be used for verifying the data authenticity
// Function to request and log user permissions on the blockchain
function logPermission(user, data) {
UnitySDK.promptForPermission(data, function(response) {
if (response.granted) {
const permissionLog = {
userId: user.id,
dataId: data.id,
timestamp: new Date().toISOString(),
consent: true
};
UnitySDK.storePermission(permissionLog).then(() => {
console.log('User permission logged on the blockchain as proof of data authenticity.');
}).catch(err => {
console.error('Failed to log permission:', err);
});
} else {
console.log('User did not grant permission.');
}
});
}
Last updated