forked from Telodendria/Telodendria
Fix runtime errors as a result of not encoding privileges as a JSON value.
This commit is contained in:
parent
a1bcbcf454
commit
647778ef82
2 changed files with 2 additions and 2 deletions
|
@ -124,7 +124,7 @@ ROUTE_IMPL(RoutePrivileges, path, argp)
|
|||
/* Fall through */
|
||||
case HTTP_GET:
|
||||
response = HashMapCreate();
|
||||
HashMapSet(response, "privileges", UserEncodePrivileges(UserGetPrivileges(user)));
|
||||
HashMapSet(response, "privileges", JsonValueArray(UserEncodePrivileges(UserGetPrivileges(user))));
|
||||
break;
|
||||
default:
|
||||
HttpResponseStatus(args->context, HTTP_BAD_REQUEST);
|
||||
|
|
|
@ -749,7 +749,7 @@ UserGetPrivileges(User * user)
|
|||
return USER_NONE;
|
||||
}
|
||||
|
||||
return UserDecodePrivileges(HashMapGet(DbJson(user->ref), "privileges"));
|
||||
return UserDecodePrivileges(JsonValueAsArray(HashMapGet(DbJson(user->ref), "privileges")));
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in a new issue