Files
SHiNE-server/shine-UI/js/services/account-voting.js
T

12 lines
694 B
JavaScript

// Только явно заявленный Primary может участвовать в официальных подтверждениях.
export function accountRoleFromHeader(accountType) {
return accountType === 1 ? 'primary' : accountType === 0 ? 'non_voting' : '';
}
export function confirmationRights(actor, target) {
const a = String(actor?.login || '').trim().toLowerCase();
const b = String(target?.login || '').trim().toLowerCase();
const primary = Boolean(a && b && a !== b && actor?.accountRole === 'primary' && target?.accountRole === 'primary');
return { primary, shine: primary && actor?.shineStatus === 'shining' && target?.shineStatus !== 'not_interested' };
}