mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 18:52:38 +00:00
Remove Google permissions check function
This commit is contained in:
@@ -264,26 +264,6 @@ const GoogleActions = {
|
|||||||
return obj.data.id;
|
return obj.data.id;
|
||||||
},
|
},
|
||||||
|
|
||||||
checkPermissions : async (auth, brew)=>{
|
|
||||||
if(!brew?.googleId) return;
|
|
||||||
const drive = googleDrive.drive({ version: 'v3', auth });
|
|
||||||
|
|
||||||
try {
|
|
||||||
const driveData = await drive.permissions.list({ fileId: brew.googleId });
|
|
||||||
const permissionsList = driveData?.data?.permissions;
|
|
||||||
|
|
||||||
if(permissionsList.some((permission)=>{
|
|
||||||
return permission.id == 'anyoneWithLink' && permission.role == 'writer';
|
|
||||||
})){
|
|
||||||
return 1;
|
|
||||||
};
|
|
||||||
} catch (err) {
|
|
||||||
return err.code;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 999;
|
|
||||||
},
|
|
||||||
|
|
||||||
getGoogleBrew : async (auth = defaultAuth, id, accessId, accessType)=>{
|
getGoogleBrew : async (auth = defaultAuth, id, accessId, accessType)=>{
|
||||||
const drive = googleDrive.drive({ version: 'v3', auth: auth });
|
const drive = googleDrive.drive({ version: 'v3', auth: auth });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user