获取权限在Office365中执行OfficeItem.organizer.getAsync时拒绝控制台消息

问题描述 投票:0回答:2

在office 365(版本1803)本地安装outlook(桌面客户端)。我们已添加了侧面板中显示的插件。它使用outlook API从桌面outlook中获取一些字段信息。它需要来自桌面outlook的这5个字段属性的信息:“subject”,“itemId”,“organizer”,“requiredAttendees”,“optionalAttendees”

我们在Appointment的撰写模式中使用getAsync API来获取这些值。

例:

  1. 如果是主题,我们在控制台中得到正确的响应。 window.Office.context.mailbox.item.subject.getAsync(function(res){console.log(res)});

输出:{status:"succeeded", value: "appointment1"}

  1. 如果是组织者 window.Office.context.mailbox.item.organizer.getAsync(function(res){console.log(res)});

输出:权限被拒绝

有关控制台错误消息,请参阅附加的图像。

注意:相同的流程在Internet Explorer浏览器中的Outlook Web APP(OWA)中正常工作。

我们在本机outlook的创建和更新流程中尝试了上述场景。

有谁知道这个问题的原因?如何在本地安装的Outlook客户端中解决此问题?

console screenshot

<?xml version="1.0" encoding="UTF-8"?>
<!--Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->
<OfficeApp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
           xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides"
           xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xsi:type="MailApp">
    <Id>69833250-ebab-4f58-8606-59df2b358121</Id>
    <Version>1.0.0.0</Version>
    <ProviderName>Oracle</ProviderName>
    <DefaultLocale>en-US</DefaultLocale>
    <DisplayName DefaultValue="Engagement Cloud"/>
    <Description DefaultValue="fuscdrmsmc151-fa-ext.us.oracle.com"/>
    <IconUrl DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/css/images/osc_icon_80.png"/>
    <HighResolutionIconUrl DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/css/images/osc_icon_80.png"/>
    <AppDomains>
        <AppDomain>https://login.microsoftonline.com/</AppDomain>
    </AppDomains>
    <Hosts>
        <Host Name="Mailbox"/>
    </Hosts>
    <Requirements>
        <Sets>
            <Set Name="MailBox" MinVersion="1.1"/>
        </Sets>
    </Requirements>
    <FormSettings>
        <Form xsi:type="ItemRead">
            <DesktopSettings>
                <SourceLocation DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/index.html"/>
                <RequestedHeight>250</RequestedHeight>
            </DesktopSettings>
        </Form>
        <Form xsi:type="ItemEdit">
            <DesktopSettings>
                <SourceLocation DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/index.html?rc_channel=COMPOSE"/>
            </DesktopSettings>
        </Form>
    </FormSettings>
    <Permissions>ReadWriteItem</Permissions>
    <Rule xsi:type="RuleCollection" Mode="Or">
        <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit"/>
        <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
        <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit"/>
        <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read"/>
    </Rule>
    <DisableEntityHighlighting>false</DisableEntityHighlighting>
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides"
                      xsi:type="VersionOverridesV1_0">
        <Hosts>
            <Host xsi:type="MailHost">
                <DesktopFormFactor>
                    <FunctionFile resid="functionFile"/>
                    <ExtensionPoint xsi:type="MessageReadCommandSurface">
                        <OfficeTab id="TabDefaultRead">
                            <Group id="oscReadGroup">
                                <Label resid="groupLabel"/>
                                <Tooltip resid="groupTooltip"/>

                                <Control xsi:type="Button" id="oscReadButton">
                                    <Label resid="buttonLabel"/>
                                    <Tooltip resid="buttonTooltip"/>
                                    <Supertip>
                                        <Title resid="superTipTitle"/>
                                        <Description resid="superTipDescription"/>
                                    </Supertip>
                                    <Icon>
                                        <bt:Image size="16" resid="osc_icon_16x16"/>
                                        <bt:Image size="32" resid="osc_icon_32x32"/>
                                        <bt:Image size="80" resid="osc_icon_80x80"/>
                                    </Icon>
                                    <Action xsi:type="ShowTaskpane">
                                        <SourceLocation resid="residOscHomeUrl"/>
                                    </Action>
                                </Control>
                            </Group>
                        </OfficeTab>
                    </ExtensionPoint>
                    <ExtensionPoint xsi:type="MessageComposeCommandSurface">
                        <OfficeTab id="TabDefaultCompose">
                            <Group id="oscComposeGroup">
                                <Label resid="groupLabel"/>
                                <Tooltip resid="groupTooltip"/>

                                <Control xsi:type="Button" id="oscComposeButton">
                                    <Label resid="buttonLabel"/>
                                    <Tooltip resid="buttonTooltip"/>
                                    <Supertip>
                                        <Title resid="superTipTitle"/>
                                        <Description resid="superTipDescription"/>
                                    </Supertip>
                                    <Icon>
                                        <bt:Image size="16" resid="osc_icon_16x16"/>
                                        <bt:Image size="32" resid="osc_icon_32x32"/>
                                        <bt:Image size="80" resid="osc_icon_80x80"/>
                                    </Icon>
                                    <Action xsi:type="ShowTaskpane">
                                        <SourceLocation resid="residOscHomeEditUrl"/>
                                    </Action>
                                </Control>
                            </Group>
                        </OfficeTab>
                    </ExtensionPoint>
                    <ExtensionPoint xsi:type="AppointmentAttendeeCommandSurface">
                        <OfficeTab id="TabDefaultApptRead">
                            <Group id="oscApptReadGroup">
                                <Label resid="groupLabel"/>
                                <Tooltip resid="groupTooltip"/>

                                <Control xsi:type="Button" id="oscApptReadButton">
                                    <Label resid="buttonLabel"/>
                                    <Tooltip resid="buttonTooltip"/>
                                    <Supertip>
                                        <Title resid="superTipTitle"/>
                                        <Description resid="superTipDescription"/>
                                    </Supertip>
                                    <Icon>
                                        <bt:Image size="16" resid="osc_icon_16x16"/>
                                        <bt:Image size="32" resid="osc_icon_32x32"/>
                                        <bt:Image size="80" resid="osc_icon_80x80"/>
                                    </Icon>
                                    <Action xsi:type="ShowTaskpane">
                                        <SourceLocation resid="residOscHomeUrl"/>
                                    </Action>
                                </Control>
                            </Group>
                        </OfficeTab>
                    </ExtensionPoint>
                    <ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">
                        <OfficeTab id="TabDefaultApptCompose">
                            <Group id="oscApptComposeGroup">
                                <Label resid="groupLabel"/>
                                <Tooltip resid="groupTooltip"/>
                                <Control xsi:type="Button" id="oscApptComposeButton">
                                    <Label resid="buttonLabel"/>
                                    <Tooltip resid="buttonTooltip"/>
                                    <Supertip>
                                        <Title resid="superTipTitle"/>
                                        <Description resid="superTipDescription"/>
                                    </Supertip>
                                    <Icon>
                                        <bt:Image size="16" resid="osc_icon_16x16"/>
                                        <bt:Image size="32" resid="osc_icon_32x32"/>
                                        <bt:Image size="80" resid="osc_icon_80x80"/>
                                    </Icon>
                                    <Action xsi:type="ShowTaskpane">
                                        <SourceLocation resid="residOscHomeEditUrl"/>
                                    </Action>
                                </Control>
                            </Group>
                        </OfficeTab>
                    </ExtensionPoint>
                </DesktopFormFactor>
            </Host>
        </Hosts>
        <Resources>
            <bt:Images>
                <bt:Image id="osc_icon_16x16" DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/css/images/osc_icon_16.png"/>
                <bt:Image id="osc_icon_32x32" DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/css/images/osc_icon_32.png"/>
                <bt:Image id="osc_icon_80x80" DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/css/images/osc_icon_80.png"/>
            </bt:Images>
            <bt:Urls>
                <bt:Url id="residOscHomeUrl" DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/index.html"/>
                <bt:Url id="residOscHomeEditUrl" DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/index.html?rc_channel=COMPOSE"/>
            </bt:Urls>
            <bt:ShortStrings>
                <bt:String id="groupLabel" DefaultValue="Engagement Cloud"/>
                <bt:String id="buttonLabel" DefaultValue="Engagement Cloud"/>
                <bt:String id="superTipTitle" DefaultValue="fuscdrmsmc151-fa-ext.us.oracle.com"/>
            </bt:ShortStrings>
            <bt:LongStrings>
                <bt:String id="groupTooltip" DefaultValue="Oracle Engagement Cloud actions"/>
                <bt:String id="buttonTooltip" DefaultValue="Launches Oracle Engagement Cloud Application"/>
                <bt:String id="superTipDescription" DefaultValue="Launches Oracle Engagement Cloud Application"/>
            </bt:LongStrings>
        </Resources>
        <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1"
                          xsi:type="VersionOverridesV1_1">
            <Hosts>
                <Host xsi:type="MailHost">
                    <DesktopFormFactor>
                        <FunctionFile resid="functionFile"/>
                        <ExtensionPoint xsi:type="MessageReadCommandSurface">
                            <OfficeTab id="TabDefaultRead">
                                <Group id="oscReadGroup">
                                    <Label resid="groupLabel"/>
                                    <Tooltip resid="groupTooltip"/>

                                    <Control xsi:type="Button" id="oscReadButton">
                                        <Label resid="buttonLabel"/>
                                        <Tooltip resid="buttonTooltip"/>
                                        <Supertip>
                                            <Title resid="superTipTitle"/>
                                            <Description resid="superTipDescription"/>
                                        </Supertip>
                                        <Icon>
                                            <bt:Image size="16" resid="osc_icon_16x16"/>
                                            <bt:Image size="32" resid="osc_icon_32x32"/>
                                            <bt:Image size="80" resid="osc_icon_80x80"/>
                                        </Icon>
                                        <Action xsi:type="ShowTaskpane">
                                            <SourceLocation resid="residOscHomeUrl"/>
                                            <SupportsPinning>true</SupportsPinning>
                                        </Action>
                                    </Control>
                                </Group>
                            </OfficeTab>
                        </ExtensionPoint>
                        <ExtensionPoint xsi:type="MessageComposeCommandSurface">
                            <OfficeTab id="TabDefaultCompose">
                                <Group id="oscComposeGroup">
                                    <Label resid="groupLabel"/>
                                    <Tooltip resid="groupTooltip"/>

                                    <Control xsi:type="Button" id="oscComposeButton">
                                        <Label resid="buttonLabel"/>
                                        <Tooltip resid="buttonTooltip"/>
                                        <Supertip>
                                            <Title resid="superTipTitle"/>
                                            <Description resid="superTipDescription"/>
                                        </Supertip>
                                        <Icon>
                                            <bt:Image size="16" resid="osc_icon_16x16"/>
                                            <bt:Image size="32" resid="osc_icon_32x32"/>
                                            <bt:Image size="80" resid="osc_icon_80x80"/>
                                        </Icon>
                                        <Action xsi:type="ShowTaskpane">
                                            <SourceLocation resid="residOscHomeEditUrl"/>
                                            <SupportsPinning>true</SupportsPinning>
                                        </Action>
                                    </Control>
                                </Group>
                            </OfficeTab>
                        </ExtensionPoint>
                        <ExtensionPoint xsi:type="AppointmentAttendeeCommandSurface">
                            <OfficeTab id="TabDefaultApptRead">
                                <Group id="oscApptReadGroup">
                                    <Label resid="groupLabel"/>
                                    <Tooltip resid="groupTooltip"/>

                                    <Control xsi:type="Button" id="oscApptReadButton">
                                        <Label resid="buttonLabel"/>
                                        <Tooltip resid="buttonTooltip"/>
                                        <Supertip>
                                            <Title resid="superTipTitle"/>
                                            <Description resid="superTipDescription"/>
                                        </Supertip>
                                        <Icon>
                                            <bt:Image size="16" resid="osc_icon_16x16"/>
                                            <bt:Image size="32" resid="osc_icon_32x32"/>
                                            <bt:Image size="80" resid="osc_icon_80x80"/>
                                        </Icon>
                                        <Action xsi:type="ShowTaskpane">
                                            <SourceLocation resid="residOscHomeUrl"/>
                                            <SupportsPinning>true</SupportsPinning>
                                        </Action>
                                    </Control>
                                </Group>
                            </OfficeTab>
                        </ExtensionPoint>
                        <ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">
                            <OfficeTab id="TabDefaultApptCompose">
                                <Group id="oscApptComposeGroup">
                                    <Label resid="groupLabel"/>
                                    <Tooltip resid="groupTooltip"/>

                                    <Control xsi:type="Button" id="oscApptComposeButton">
                                        <Label resid="buttonLabel"/>
                                        <Tooltip resid="buttonTooltip"/>
                                        <Supertip>
                                            <Title resid="superTipTitle"/>
                                            <Description resid="superTipDescription"/>
                                        </Supertip>
                                        <Icon>
                                            <bt:Image size="16" resid="osc_icon_16x16"/>
                                            <bt:Image size="32" resid="osc_icon_32x32"/>
                                            <bt:Image size="80" resid="osc_icon_80x80"/>
                                        </Icon>
                                        <Action xsi:type="ShowTaskpane">
                                            <SourceLocation resid="residOscHomeEditUrl"/>
                                            <SupportsPinning>true</SupportsPinning>
                                        </Action>
                                    </Control>
                                </Group>
                            </OfficeTab>
                        </ExtensionPoint>
                    </DesktopFormFactor>
                </Host>
            </Hosts>
            <Resources>
                <bt:Images>
                    <bt:Image id="osc_icon_16x16"
                              DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/css/images/osc_icon_16.png"/>
                    <bt:Image id="osc_icon_32x32"
                              DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/css/images/osc_icon_32.png"/>
                    <bt:Image id="osc_icon_80x80"
                              DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/css/images/osc_icon_80.png"/>
                </bt:Images>
                <bt:Urls>
                    <bt:Url id="residOscHomeUrl"
                            DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/index.html"/>
                    <bt:Url id="residOscHomeEditUrl"
                            DefaultValue="https://fuscdrmsmc151-fa-ext.us.oracle.com/crmUI/osc365/web/index.html?rc_channel=COMPOSE"/>
                </bt:Urls>
                <bt:ShortStrings>
                    <bt:String id="groupLabel" DefaultValue="Engagement Cloud"/>
                    <bt:String id="buttonLabel" DefaultValue="Engagement Cloud"/>
                    <bt:String id="superTipTitle" DefaultValue="fuscdrmsmc151-fa-ext.us.oracle.com"/>
                </bt:ShortStrings>
                <bt:LongStrings>
                    <bt:String id="groupTooltip" DefaultValue="Oracle Engagement Cloud actions"/>
                    <bt:String id="buttonTooltip" DefaultValue="Launches Oracle Engagement Cloud Application"/>
                    <bt:String id="superTipDescription" DefaultValue="Launches Oracle Engagement Cloud Application"/>
                </bt:LongStrings>
            </Resources>
        </VersionOverrides>
    </VersionOverrides>
</OfficeApp>
office-js outlook-web-addins
2个回答
0
投票

您在清单中指定了哪些权限?

Outlook加载项在其清单中指定所需的权限级别。可用的水平是RestrictedReadItemReadWriteItemReadWriteMailbox。这些权限级别是累积的:Restricted是最低级别,每个更高级别包括所有较低级别的权限。 ReadWriteMailbox包含所有支持的权限。

Restricted许可是最基本的许可级别。在清单中的Restricted元素中指定Permissions以请求此权限。如果加载项未在其清单中请求特定权限,则Outlook会默认将此权限分配给邮件加载项。

尝试访问主题或组织者等成员将返回null并导致出现错误消息,指出Outlook要求邮件加载项具有提升的权限。您必须至少请求ReadItem权限。


0
投票

版本1803中未实现organizer.getAsync API。我建议在调用API之前通过Office.context.requirements.isSetSupported("Mailbox", 1.7)检查需求集。这将允许您在使用API​​之前了解客户端版本是否支持需求集。

© www.soinside.com 2019 - 2024. All rights reserved.