Skip to content

Commit

Permalink
Add support for "permissions granting" via Control Panel > Privilege
Browse files Browse the repository at this point in the history
Add support to open an URL in DSM's window instead of opening new Browser's tab/window
  • Loading branch information
vletroye committed Dec 9, 2017
1 parent 74bf030 commit 3b14418
Show file tree
Hide file tree
Showing 100 changed files with 402 additions and 225 deletions.
Binary file modified Json Editor/bin/Debug/ScintillaNET.dll
Binary file not shown.
Binary file modified Json Editor/bin/Debug/ScintillaNET.pdb
Binary file not shown.
Binary file modified Json Editor/bin/Debug/ZTn.Json.Editor.dll
Binary file not shown.
Binary file modified Json Editor/bin/Debug/ZTn.Json.Editor.pdb
Binary file not shown.
Binary file not shown.
Binary file modified Json Editor/obj/Debug/ZTn.Json.Editor.dll
Binary file not shown.
Binary file modified Json Editor/obj/Debug/ZTn.Json.Editor.pdb
Binary file not shown.
Binary file modified MyOwnDSMShortcuts/.vs/Mods/v14/.suo
Binary file not shown.
74 changes: 73 additions & 1 deletion MyOwnDSMShortcuts/AppsData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,75 @@ public AppsData()
itemType = -1;
}


// Custom MODS' parameters
internal Guid guid { get; set; }
//-1: undefined
//0: url
//1: script
//2: webapp
public int itemType { get; set; }

// Synology url's parameters

/*
{
".url": {
"<unique_name>": {
"type": "legacy",
"allUsers": false,
"allowMultiInstance": false,
"title": "DDNS updater",
"icon": "images / ddnsupdater_ {0} .png",
"appWindow": "<unique_name>",
"width": 960,
"height": 550,
"url": "/webman/3rdparty/ddnsupdater/ddnsupdater.php"
}
}
}
Parameter Description; Mandatory Documented Value / Type / Example
<Unique_Name>: Unique name, eg SYNO.SDS._ThirdParty.App.<application name>, ✔ ✔ alphanumeric (without the - )
without minus characters, otherwise the legacy type will not work.;
type: For the window (embedded) solution, the key word ""legacy"" is used.  ✔ ✔ legacy, url (there are more values, but these are not suitable for use with 3rdparty applications)
If the application is to be called up in a new window, ""url"" must
be entered.
allusers: Defines who is allowed to call the application - ✔ only for admin (false), for all users (true)
allowMultiInstance: Allows the multiple opening of the application, - - false, true
but there are still no empirical values
grant privilege: With this setting, the authorization to start the application can - - all, local, ldap, domain
be regulated. If this option is enabled, the application will appear
under "Control Panel - Users - Applications" or
"Control Panel - Permissions". Important: To make this work for
3rdparty apps, please read this post before http://www.synology-wiki.de/index.php/Aufbau_der_Datei_%27config%27
title: Yhe title of the application ✔ ✔ alphanumeric
desc: Text that appears in a mouse-over over the icon in the DSM - ✔ alphanumeric, possibly also UTF-8 text
texts: Specifies the folder within the application directory in which the - ✔ alphanumeric
files with the texts of the corresponding languages ​​are located. 
If the option is available, the desired text can be accessed
using <section>: <variable>. (eg for title or desc)
icon: The icon of the application for the 4 resolutions (16,24,32,48px), ✔ ✔ 16, 24, 32, 48
the variable {0} is automatically filled with one of the 4 resolutions
AppWindow: The name of the application must be entered here, as in the parameter - - alphanumeric, necessary for type legacy?
<unique_name> above
width / height: The width / height of the application window when called in pixels - - numeric
url: The call address of the application, absolute URL or relative to ✔ ✔ relative path ( must then start with a / ) or absolute URL
the DocumentRoot of the port listening server
(usually / usr / syno / synoman or / var / services / web)
protocol: URL protocol to the application. If this parameter is not specified, - - Values ​​are eg "http", "https", "ftp". 
the current protocol of the DSM is used. protocol and port must always If an absolute address is entered in url, this value is ignored
be specified together
port: The port of the link to be invoked on the DS. If this parameter is - - numeric with quotation marks, eg "port": "80" (for http), "port": "443" (https), "port": "21" (ftp)
not specified, default uses the current port of the DSM
advance grant privilege: An extended possibility to limit the users who are allowed to call - - false, true
this application (in addition to "grantPrivilege" groups and IP's)
configablePrivilege: To disable the ability to set the permission, even though the - - false, true
grantPrivilege option is enabled.
*/

public string type { get; set; }
public bool allUsers { get; set; }
public string title { get; set; }
Expand All @@ -36,7 +104,11 @@ public AppsData()
public string protocol { get; set; }
public string url { get; set; }
public int port { get; set; }
public int itemType { get; set; }
public bool allowMultiInstance { get; set; }
public bool configablePrivilege { get; set; }
public bool advanceGrantPrivilege { get; set; }
public string grantPrivilege { get; set; }
public int width { get; set; }
public int height { get; set; }
}
}
Loading

0 comments on commit 3b14418

Please sign in to comment.