Skip to content

Commit ce08db6

Browse files
author
Scott Powell
committed
* room server: ClientACL added
1 parent de2e0cf commit ce08db6

File tree

5 files changed

+183
-150
lines changed

5 files changed

+183
-150
lines changed

examples/simple_repeater/MyMesh.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ int MyMesh::handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t
168168
memcpy(&reply_data[4], telemetry.getBuffer(), tlen);
169169
return 4 + tlen; // reply_len
170170
}
171-
if (payload[0] == REQ_TYPE_GET_ACCESS_LIST && (sender->permissions & PERM_ACL_ROLE_MASK) == PERM_ACL_ADMIN) {
171+
if (payload[0] == REQ_TYPE_GET_ACCESS_LIST && sender->isAdmin()) {
172172
uint8_t res1 = payload[1]; // reserved for future (extra query params)
173173
uint8_t res2 = payload[2];
174174
if (res1 == 0 && res2 == 0) {
@@ -672,7 +672,7 @@ void MyMesh::handleCommand(uint32_t sender_timestamp, char *command, char *reply
672672
command += 3;
673673
}
674674

675-
// handle sensor-specific CLI commands
675+
// handle ACL related commands
676676
if (memcmp(command, "setperm ", 8) == 0) { // format: setperm {pubkey-hex} {permissions-int8}
677677
char* hex = &command[8];
678678
char* sp = strchr(hex, ' '); // look for separator char
@@ -743,7 +743,7 @@ void MyMesh::loop() {
743743
MESH_DEBUG_PRINTLN("Radio params restored");
744744
}
745745

746-
// is there are pending dirty contacts write needed?
746+
// is pending dirty contacts write needed?
747747
if (dirty_contacts_expiry && millisHasNowPassed(dirty_contacts_expiry)) {
748748
acl.save(_fs);
749749
dirty_contacts_expiry = 0;

0 commit comments

Comments
 (0)