File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,14 @@ class Auth {
162162 public function authorize (): bool {
163163 # Variables
164164 $ is_not_authorized = false ;
165- $ this ->client_privileges = get_user_privileges (getUserEntry ($ this ->username ));
165+
166+ # Start with pfSense 24.11, getUserEntry returns an array with the key 'item' containing the user data.
167+ # We need to handle both cases to support both.
168+ $ user_ent = getUserEntry ($ this ->username );
169+ $ user_ent = (array_key_exists ('item ' , $ user_ent )) ? $ user_ent ['item ' ] : $ user_ent ;
170+
171+ # Obtain the client's privileges and check if they have the required privileges
172+ $ this ->client_privileges = get_user_privileges ($ user_ent );
166173
167174 # This client is not authorized if the client does not have at least one of the required privileges
168175 if ($ this ->required_privileges and !array_intersect ($ this ->required_privileges , $ this ->client_privileges )) {
You can’t perform that action at this time.
0 commit comments