본문 바로가기
#포트폴리오 [Portfolio]/SystemKit (오픈소스)

🗂 [Guide] SKPermission

by cy_mos 2022. 9. 28.
반응형

🗂 SKPermission

SKPermission는 iOS 또는 macOS 운영체제에서 애플리케이션 구동에 필요 한 다양한 권한 [파일 및 폴더 권한 (Files and Folders), 전체 디스크 접근 권한 (Full Disk Access), 사진 (Photos), 연락처 (AddressBook), 블루투스 (Bluetooth), 캘린더 (Calendar)] 등을 손쉽게 관리할 수 있습니다.

Example Source

SKPermission 예제 소스코드는 아래와 같습니다.

// 공유하기 환경설정 페이지를 표시합니다.
SKSystem.shared.openPreferencePane(path: SKSharingPreferencePane.Main.rawValue)

// Screentime 환경설정 페이지를 표시합니다.
SKPermission.shared.openPreferencePane(path: SKDefaultPreferencePane.Screentime.rawValue)

// 전체 디스크 접근 권한 (Full Disk Access) 여부를 확인합니다. 
let isPermission: Bool = SKPermission.shared.isFullDiskAccessPermission()
print(isPermission)

// com.apple.Terminal 애플리케이션 권한을 제거합니다.
SKPermission.shared.managePrivacyPermission(service: .SystemPolicyDesktopFolder, bundlePath: "com.apple.Terminal")

License

SystemKit is released under the MIT license. See LICENSE for details.


MIT License

Copyright (c) 2022 ChangYeop-Yang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
반응형

'#포트폴리오 [Portfolio] > SystemKit (오픈소스)' 카테고리의 다른 글

🗂 [Guide] SKProcessMonitor  (0) 2022.10.24
🗂 [Guide] SKSignal  (0) 2022.10.24
🗂 [Guide] SKFinderExtension  (0) 2022.09.18
🗂 [Guide] SKProcess  (0) 2022.09.18
🗂 [Guide] SKUserDefault  (0) 2022.09.18

댓글