@@ -685,7 +685,8 @@ void GeoFamily::GeoSearch(CmdArgList args, const CommandContext& cmd_cntx) {
685
685
GeoSearchStoreGeneric (cmd_cntx.tx , builder, shape, key, member, geo_ops);
686
686
}
687
687
688
- void GeoFamily::GeoRadiusByMember (CmdArgList args, const CommandContext& cmd_cntx) {
688
+ void GeoFamily::GeoRadiusByMemberGeneric (CmdArgList args, const CommandContext& cmd_cntx,
689
+ bool read_only) {
689
690
GeoShape shape = {};
690
691
GeoSearchOpts geo_ops;
691
692
// parse arguments
@@ -737,7 +738,7 @@ void GeoFamily::GeoRadiusByMember(CmdArgList args, const CommandContext& cmd_cnt
737
738
geo_ops.withdist = true ;
738
739
} else if (cur_arg == " WITHHASH" ) {
739
740
geo_ops.withhash = true ;
740
- } else if (cur_arg == " STORE" ) {
741
+ } else if (cur_arg == " STORE" && !read_only ) {
741
742
if (geo_ops.store != GeoStoreType::kNoStore ) {
742
743
return builder->SendError (kStoreTypeErr );
743
744
}
@@ -748,7 +749,7 @@ void GeoFamily::GeoRadiusByMember(CmdArgList args, const CommandContext& cmd_cnt
748
749
} else {
749
750
return builder->SendError (kSyntaxErr );
750
751
}
751
- } else if (cur_arg == " STOREDIST" ) {
752
+ } else if (cur_arg == " STOREDIST" && !read_only ) {
752
753
if (geo_ops.store != GeoStoreType::kNoStore ) {
753
754
return builder->SendError (kStoreTypeErr );
754
755
}
@@ -773,6 +774,14 @@ void GeoFamily::GeoRadiusByMember(CmdArgList args, const CommandContext& cmd_cnt
773
774
GeoSearchStoreGeneric (cmd_cntx.tx , builder, shape, key, member, geo_ops);
774
775
}
775
776
777
+ void GeoFamily::GeoRadiusByMember (CmdArgList args, const CommandContext& cmd_cntx) {
778
+ GeoRadiusByMemberGeneric (args, cmd_cntx, false );
779
+ }
780
+
781
+ void GeoFamily::GeoRadiusByMemberRO (CmdArgList args, const CommandContext& cmd_cntx) {
782
+ GeoRadiusByMemberGeneric (args, cmd_cntx, true );
783
+ }
784
+
776
785
void GeoFamily::GeoRadiusGeneric (CmdArgList args, const CommandContext& cmd_cntx, bool read_only) {
777
786
GeoShape shape = {};
778
787
GeoSearchOpts geo_ops;
@@ -893,6 +902,7 @@ constexpr uint32_t kGeoPos = READ | GEO | SLOW;
893
902
constexpr uint32_t kGeoDist = READ | GEO | SLOW;
894
903
constexpr uint32_t kGeoSearch = READ | GEO | SLOW;
895
904
constexpr uint32_t kGeoRadiusByMember = WRITE | GEO | SLOW;
905
+ constexpr uint32_t kGeoRadiusByMemberRO = READ | GEO | SLOW;
896
906
constexpr uint32_t kGeoRadius = WRITE | GEO | SLOW;
897
907
constexpr uint32_t kGeoRadiusRO = READ | GEO | SLOW;
898
908
} // namespace acl
@@ -907,6 +917,8 @@ void GeoFamily::Register(CommandRegistry* registry) {
907
917
<< CI{" GEOSEARCH" , CO::READONLY, -7 , 1 , 1 , acl::kGeoSearch }.HFUNC (GeoSearch)
908
918
<< CI{" GEORADIUSBYMEMBER" , CO::WRITE | CO::STORE_LAST_KEY, -5 , 1 , 1 , acl::kGeoRadiusByMember }
909
919
.HFUNC (GeoRadiusByMember)
920
+ << CI{" GEORADIUSBYMEMBER_RO" , CO::READONLY, -5 , 1 , 1 , acl::kGeoRadiusByMemberRO }.HFUNC (
921
+ GeoRadiusByMemberRO)
910
922
<< CI{" GEORADIUS" , CO::WRITE | CO::STORE_LAST_KEY, -6 , 1 , 1 , acl::kGeoRadius }.HFUNC (GeoRadius)
911
923
<< CI{" GEORADIUS_RO" , CO::READONLY, -6 , 1 , 1 , acl::kGeoRadiusRO }.HFUNC (GeoRadiusRO);
912
924
}
0 commit comments