Overte C++ Documentation
ScriptPermissions.h
1 //
2 // ScriptPermissions.h
3 // libraries/script-engine/src/ScriptPermissions.h
4 //
5 // Created by dr Karol Suprynowicz on 2024/03/24.
6 // Copyright 2024 Overte e.V.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #pragma once
13 
14 #include <vector>
15 
16 #include "SettingHandle.h"
17 #include "DependencyManager.h"
18 
19 class ScriptPermissions {
20 public:
21  enum class Permission {
22  SCRIPT_PERMISSION_GET_AVATAR_URL,
23  SCRIPT_PERMISSIONS_SIZE
24  };
25 
26  static bool isCurrentScriptAllowed(Permission permission);
27  //TODO: add a function to request permission through a popup
28 };
29 
30 // TODO: add ScriptPermissionsScriptingInterface, where script can check if they have permissions
31 // and request permissions through a tablet popup.