superdesk/superdesk-client-core

View on GitHub
scripts/core/interactive-article-actions-panel/utils/can-send-to-personal.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import {IArticle} from 'superdesk-api';
import {appConfig} from 'appConfig';
import {sdApi} from 'api';

export function canSendToPersonal(items: Array<IArticle>) {
    const haveDeskSet = items.every((item) => item.task?.desk != null);

    return haveDeskSet
        && appConfig?.features?.sendToPersonal === true
        && sdApi.user.hasPrivilege('send_to_personal');
}