luajitos

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

Permissions.txt (1882B)


      1 I want LuaJITOS to use a new permission system, simmilar to what android has.
      2 
      3 each application comes with a manifest.lua file, this file has the following stucture:
      4 
      5 return {
      6     app = {
      7         name = "testapp2";
      8         dev = "testdev";
      9         support = "testdev@xmail.com"
     10         privateDir = true; -- gives the program its own folder /apps/addDev.appName/appdata where it can read and write freely, this folder can be accessed by $/my_file.txt
     11         version = "0.0.3"
     12     }
     13     paths = {
     14         all = {
     15             "~/Documents/"
     16         };
     17 
     18         -- or
     19 
     20         read = {
     21             "~/Documents/"
     22         };
     23         write = {
     24             "~/Documents/"
     25         };
     26         delete = {
     27             "~/Documents/"
     28         };
     29         move = {
     30             "~/Documents/"
     31         };
     32     };
     33     domains = {
     34         "www.example.com",
     35         "*.example.com"
     36     }
     37     permissions = {
     38         requestPermissions = true; --alows the app to request permissions at runtime like android
     39 
     40         system = {
     41             execute = false;
     42             enviroment = false;
     43             info = false;
     44             time = true;
     45         };
     46 
     47         fs = {
     48             read = true;
     49             write = true;
     50             delete = false;
     51             mount = false;
     52         };
     53 
     54         net = {
     55             internet = true;
     56             local = false;
     57             listen = false;
     58         };
     59 
     60         hardware = {
     61             audioOut = true;
     62             audioIn = false;
     63             camera = false;
     64             usb = false;
     65         };
     66 
     67         security = {
     68             crypto = true;
     69             keyring = true;
     70         }
     71 
     72     }
     73 };
     74 
     75 This lua file is run sandboxed, without any functions, even string and maths removed. It can only return a single table and that MUST have app {name = ... dev  = ... }, permissions can be a table of permission or "none", "sandboxed", "user", "admin", "superadmin"