ตรวจสอบ API สิทธิ์
ในฐานะนักพัฒนาของวิชวล Power BI คุณสามารถพัฒนาวิชวลที่ต้องการสิทธิ์ในการเข้าถึงแหล่งข้อมูลต่าง ๆ คุณร้องขอสิทธิ์เหล่านี้ในส่วนสิทธิ์การใช้งานของไฟล์ capabilities.json สิทธิพิเศษเหล่านี้รวมถึงความสามารถในการเข้าถึง:
- แหล่งข้อมูลระยะไกลหรือเว็บไซต์
- ที่เก็บข้อมูลภายในเครื่องสําหรับการดาวน์โหลดข้อมูล
ผู้ดูแลระบบของแต่ละองค์กรสามารถอนุญาตหรือบล็อกสิทธิ์เหล่านี้ได้ API สิทธิ์การตรวจสอบช่วยให้คุณสามารถคิวรีโฮสต์ในขณะทํางานเพื่อกําหนดสิทธิ์ที่ได้รับ คุณสามารถใช้ข้อมูลนี้เพื่อออกแบบวิชวลที่จะทํางานกับการตั้งค่าสิทธิ์ต่าง ๆ
API สิทธิ์การตรวจสอบจะส่งกลับสถานะของฟังก์ชันคิวรีสิทธิ์แต่ละรายการ:
/**
* Represents a return type for privilege status query methods
*/
export const enum PrivilegeStatus {
/**
* The privilege is allowed in the current environment
*/
Allowed,
/**
* The privilege declaration is missing in visual capabilities section
*/
NotDeclared,
/**
* The privilege is not supported in the current environment
*/
NotSupported,
/**
* The privilege usage was denied by tenant administrator
*/
DisabledByAdmin,
}
วิธีการใช้ API ตรวจสอบสิทธิ์
API สิทธิ์การใช้งานทั้งหมดมีวิธีการคิวรีของตนเองเพื่อตรวจสอบสถานะสิทธิ์ สถานะสิทธิ์อาจเป็นหนึ่งในรายการต่อไปนี้:
- อนุญาต
- ยังไม่ได้ประกาศ
- ไม่ได้รับการสนับสนุน
- ปิดใช้งานโดยผู้ดูแลระบบ
การเข้าถึงเว็บ
export interface IWebAccessService {
/**
* Returns the availability status of the service for specified url.
*
* @param url - the URL to check status for
* @returns the promise that resolves to privilege status of the service
*/
webAccessStatus(url: string): IPromise<PrivilegeStatus>;
}
ส่งออกเนื้อหา
export interface IDownloadService {
/**
* Returns the availability status of the service.
*
* @returns the promise that resolves to privilege status of the service
*/
exportStatus(): IPromise<PrivilegeStatus>;
}