Add error notification when lacking the upload permission
This commit is contained in:
parent
63f985aa0e
commit
a5357a90a5
2 changed files with 10 additions and 1 deletions
|
|
@ -22,7 +22,8 @@
|
|||
"notifs": {
|
||||
"error": {
|
||||
"db-out-of-date": "Database out of date, please try again.",
|
||||
"document-ID-404": "Cannot find {dbType} with ID: {id}"
|
||||
"document-ID-404": "Cannot find {dbType} with ID: {id}",
|
||||
"no-upload-permission": "Cannot save due to missing the \"Upload Files\" permission."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,14 @@ export function DBConnectorMixin(HandlebarsApp) {
|
|||
};
|
||||
|
||||
async isAbleToSave() {
|
||||
if (!game.user.can(`FILES_UPLOAD`)) {
|
||||
ui.notifications.error(
|
||||
`TB.notifs.error.no-upload-permission`,
|
||||
{ localize: true },
|
||||
);
|
||||
return false;
|
||||
};
|
||||
|
||||
if (!this._docID) { return true };
|
||||
|
||||
const newLastModified = await lastModifiedAt(this.dbPath);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue