mirror of https://github.com/nymea/nymea.git
Fix allowed things loading
parent
82fe7c7ae3
commit
cfe4328776
|
|
@ -311,6 +311,9 @@ JsonReply *UsersHandler::RemoveUser(const QVariantMap ¶ms, const JsonContext
|
|||
JsonReply *UsersHandler::SetUserScopes(const QVariantMap ¶ms, const JsonContext &context)
|
||||
{
|
||||
Q_UNUSED(context)
|
||||
|
||||
qCWarning(dcJsonRpc()) << params;
|
||||
|
||||
QString username = params.value("username").toString();
|
||||
Types::PermissionScopes scopes = Types::scopesFromStringList(params.value("scopes").toStringList());
|
||||
QList<ThingId> allowedThingIds = Types::thingIdsFromStringList(params.value("allowedThingIds").toStringList());
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ class UserInfo
|
|||
Q_PROPERTY(QString email READ email)
|
||||
Q_PROPERTY(QString displayName READ displayName)
|
||||
Q_PROPERTY(Types::PermissionScopes scopes READ scopes)
|
||||
Q_PROPERTY(QList<ThingId> allowedThingIds READ allowedThingIds)
|
||||
|
||||
public:
|
||||
UserInfo();
|
||||
|
|
|
|||
|
|
@ -56,8 +56,11 @@ QStringList Types::thingIdsToStringList(const QList<ThingId> &thingIds)
|
|||
QList<ThingId> Types::thingIdsFromStringList(const QStringList &stringList)
|
||||
{
|
||||
QList<ThingId> thingIds;
|
||||
foreach (const QString &idString, stringList)
|
||||
thingIds.append(ThingId(idString));
|
||||
foreach (const QString &idString, stringList) {
|
||||
if (!idString.isEmpty()) {
|
||||
thingIds.append(ThingId(idString));
|
||||
}
|
||||
}
|
||||
|
||||
return thingIds;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue