Skip to content

Commit 79a81a6

Browse files
fix: fixed priv handling in api docs
1 parent c299d17 commit 79a81a6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • pfSense-pkg-API/files/usr/local/www/api/documentation

pfSense-pkg-API/files/usr/local/www/api/documentation/index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
session_start();
66

77
# Redirect user if they do not have privilege to access this page
8-
$user_privs = get_user_privileges(getUserEntry($_SESSION["Username"]));
8+
$client_config =& getUserEntry($_SESSION["Username"]);
9+
$client_config = (array_key_exists('item', $client_config)) ? $client_config['item'] : $client_config;
10+
$user_privs = get_user_privileges($client_config);
911
if (!in_array("page-system-api", $user_privs) and !in_array("page-all", $user_privs)) {
1012
header("Location: /");
1113
exit();

0 commit comments

Comments
 (0)