Correction "lacks permission to update"
Correction de message d'erreur 'User ... lacks permission to update Item ... in parent Actor' Causé par le traitement d'un hook onUpdateActor qui semble autorisé à modifier l'actor, mais ne l'est pas - lors de modifications/ajouts de blessures - lors de l'ajout d'effets
This commit is contained in:
parent
2c836f17e7
commit
864194e3b4
@ -189,13 +189,7 @@ export class Misc {
|
||||
* and there is no connected GM
|
||||
*/
|
||||
static documentIfResponsible(document) {
|
||||
if (foundry.utils.isNewerVersion(game.release.version, '12.0')) {
|
||||
if (game.users.activeGM || (Misc.connectedGMs().length == 0 && Misc.isOwnerPlayer(document)))
|
||||
{
|
||||
return document
|
||||
}
|
||||
}
|
||||
else if (Misc.isFirstConnectedGM() || (Misc.connectedGMs().length == 0 && Misc.isOwnerPlayer(document))) {
|
||||
if (Misc.isFirstConnectedGM() || (Misc.connectedGMs().length == 0 && Misc.isFirstOwnerPlayer(document))) {
|
||||
return document
|
||||
}
|
||||
return undefined
|
||||
@ -205,8 +199,15 @@ export class Misc {
|
||||
return document.testUserPermission && document.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)
|
||||
}
|
||||
|
||||
static isFirstOwnerPlayer(document) {
|
||||
if (!document.testUserPermission){
|
||||
return false
|
||||
}
|
||||
return game.users.filter(u => document.testUserPermission(u, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)) == game.user
|
||||
}
|
||||
|
||||
static isOwnerPlayerOrUniqueConnectedGM(actor) {
|
||||
return Misc.isOwnerPlayer(actor) ?? Misc.isFirstConnectedGM();
|
||||
return Misc.isFirstOwnerPlayer(actor) ?? Misc.isFirstConnectedGM();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user