fix: xref failed

This commit is contained in:
zhongwencool 2023-10-20 11:46:31 +08:00
parent 281add1464
commit 8b5ec2a4d5
1 changed files with 4 additions and 4 deletions

View File

@ -204,7 +204,7 @@ authorize(_Path, Req, ApiKey, ApiSecret) ->
case find_by_api_key(ApiKey) of case find_by_api_key(ApiKey) of
{ok, true, ExpiredAt, SecretHash, Role} when ExpiredAt >= Now -> {ok, true, ExpiredAt, SecretHash, Role} when ExpiredAt >= Now ->
case emqx_dashboard_admin:verify_hash(ApiSecret, SecretHash) of case emqx_dashboard_admin:verify_hash(ApiSecret, SecretHash) of
ok -> check_rbac(Req, Role); ok -> check_rbac(Req, ApiKey, Role);
error -> {error, "secret_error"} error -> {error, "secret_error"}
end; end;
{ok, true, _ExpiredAt, _SecretHash, _Role} -> {ok, true, _ExpiredAt, _SecretHash, _Role} ->
@ -396,8 +396,8 @@ add_bootstrap_file(File, Dev, MP, Line) ->
end. end.
-if(?EMQX_RELEASE_EDITION == ee). -if(?EMQX_RELEASE_EDITION == ee).
check_rbac(Req, Role) -> check_rbac(Req, ApiKey, Role) ->
case emqx_dashboard_rbac:check_rbac(Req, Role) of case emqx_dashboard_rbac:check_rbac(Req, ApiKey, Role) of
true -> true ->
ok; ok;
_ -> _ ->
@ -412,7 +412,7 @@ valid_role(Role) ->
-else. -else.
check_rbac(_Req, _Role) -> check_rbac(_Req, _ApiKey, _Role) ->
ok. ok.
format_app_extend(App) -> format_app_extend(App) ->