diff --git a/libnymea-core/jsonrpc/appdatahandler.cpp b/libnymea-core/jsonrpc/appdatahandler.cpp index f8a2acfb..a0c665df 100644 --- a/libnymea-core/jsonrpc/appdatahandler.cpp +++ b/libnymea-core/jsonrpc/appdatahandler.cpp @@ -26,7 +26,7 @@ AppDataHandler::AppDataHandler(QObject *parent) : JsonHandler(parent) params.insert("o:group", enumValueName(String)); params.insert("key", enumValueName(String)); params.insert("value", enumValueName(String)); - registerMethod("Store", description, params, returns); + registerMethod("Store", description, params, returns, Types::PermissionScopeConfigureThings); description.clear(); params.clear(); returns.clear(); description = "Retrieve an app data storage value that has previously been set with Store(). If no value " @@ -35,7 +35,7 @@ AppDataHandler::AppDataHandler(QObject *parent) : JsonHandler(parent) params.insert("o:group", enumValueName(String)); params.insert("key", enumValueName(String)); returns.insert("value", enumValueName(String)); - registerMethod("Load", description, params, returns); + registerMethod("Load", description, params, returns, Types::PermissionScopeControlThings); // Notifications description.clear(); params.clear(); diff --git a/libnymea-core/jsonrpc/tagshandler.cpp b/libnymea-core/jsonrpc/tagshandler.cpp index eff2024d..f1845d90 100644 --- a/libnymea-core/jsonrpc/tagshandler.cpp +++ b/libnymea-core/jsonrpc/tagshandler.cpp @@ -54,7 +54,7 @@ TagsHandler::TagsHandler(QObject *parent) : JsonHandler(parent) params.insert("o:tagId", enumValueName(String)); returns.insert("tagError", enumRef()); returns.insert("o:tags", objectRef("Tags")); - registerMethod("GetTags", description, params, returns); + registerMethod("GetTags", description, params, returns, Types::PermissionScopeControlThings); params.clear(); returns.clear(); description = "Add a Tag. " @@ -65,7 +65,7 @@ TagsHandler::TagsHandler(QObject *parent) : JsonHandler(parent) "the TagValueChanged notification will be emitted."; params.insert("tag", objectRef("Tag")); returns.insert("tagError", enumRef()); - registerMethod("AddTag", description, params, returns); + registerMethod("AddTag", description, params, returns, Types::PermissionScopeControlThings); params.clear(); returns.clear(); description = "Remove a Tag. " @@ -73,7 +73,7 @@ TagsHandler::TagsHandler(QObject *parent) : JsonHandler(parent) "TagRemoved notification will be emitted."; params.insert("tag", objectRef("Tag")); returns.insert("tagError", enumRef()); - registerMethod("RemoveTag", description, params, returns); + registerMethod("RemoveTag", description, params, returns, Types::PermissionScopeControlThings); // Notifications params.clear(); diff --git a/tests/auto/api.json b/tests/auto/api.json index dbc94d4f..a7a57d85 100644 --- a/tests/auto/api.json +++ b/tests/auto/api.json @@ -566,7 +566,7 @@ "key": "String", "o:group": "String" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeControlThings", "returns": { "value": "String" } @@ -579,7 +579,7 @@ "o:group": "String", "value": "String" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeConfigureThings", "returns": { } }, @@ -1595,7 +1595,7 @@ "o:stateEvaluator": "$ref:StateEvaluator", "o:timeDescriptor": "$ref:TimeDescriptor" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeConfigureRules", "returns": { "o:ruleId": "Uuid", "ruleError": "$ref:RuleError" @@ -1606,7 +1606,7 @@ "params": { "ruleId": "Uuid" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeConfigureRules", "returns": { "ruleError": "$ref:RuleError" } @@ -1630,7 +1630,7 @@ "o:timeDescriptor": "$ref:TimeDescriptor", "ruleId": "Uuid" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeConfigureRules", "returns": { "o:rule": "$ref:Rule", "ruleError": "$ref:RuleError" @@ -1641,7 +1641,7 @@ "params": { "ruleId": "Uuid" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeConfigureRules", "returns": { "ruleError": "$ref:RuleError" } @@ -1651,7 +1651,7 @@ "params": { "ruleId": "Uuid" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeExecuteRules", "returns": { "ruleError": "$ref:RuleError" } @@ -1661,7 +1661,7 @@ "params": { "ruleId": "Uuid" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeExecuteRules", "returns": { "ruleError": "$ref:RuleError" } @@ -1671,7 +1671,7 @@ "params": { "thingId": "Uuid" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeExecuteRules", "returns": { "ruleIds": [ "Uuid" @@ -1683,7 +1683,7 @@ "params": { "ruleId": "Uuid" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeExecuteRules", "returns": { "o:rule": "$ref:Rule", "ruleError": "$ref:RuleError" @@ -1693,7 +1693,7 @@ "description": "Get the descriptions of all configured rules. If you need more information about a specific rule use the method Rules.GetRuleDetails.", "params": { }, - "permissionScope": "PermissionScopeConfigureRules", + "permissionScope": "PermissionScopeExecuteRules", "returns": { "ruleDescriptions": [ "$ref:RuleDescription" @@ -1705,7 +1705,7 @@ "params": { "ruleId": "Uuid" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeConfigureRules", "returns": { "ruleError": "$ref:RuleError" } @@ -1935,7 +1935,7 @@ "params": { "tag": "$ref:Tag" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeControlThings", "returns": { "tagError": "$ref:TagError" } @@ -1948,7 +1948,7 @@ "o:tagId": "String", "o:thingId": "Uuid" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeControlThings", "returns": { "o:tags": "$ref:Tags", "tagError": "$ref:TagError" @@ -1959,7 +1959,7 @@ "params": { "tag": "$ref:Tag" }, - "permissionScope": "PermissionScopeAdmin", + "permissionScope": "PermissionScopeControlThings", "returns": { "tagError": "$ref:TagError" }