Skip to content

Commit 83110e5

Browse files
committed
exmdb: let PR_ACCESS include permissions from all group memberships
Mimic EXC2019 behavior in conveying PR_RIGHTS to be the set union of all permission bits from all group memberships. (There seems to be no way to deny a group access.) An exact username ACE match still outranks groups though, and a group match outranks standard/anonymous ACEs. References: DESK-2620
1 parent d6cb7ab commit 83110e5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

exch/exmdb/common_util.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3999,12 +3999,15 @@ BOOL cu_get_folder_permission(sqlite3 *psqlite, uint64_t folder_id,
39993999
auto pstmt1 = gx_sql_prep(psqlite, sql_string);
40004000
if (pstmt1 == nullptr)
40014001
return FALSE;
4002+
bool group_match = false;
40024003
while (pstmt1.step() == SQLITE_ROW) {
40034004
if (common_util_check_mlist_include(pstmt1.col_text(0), username)) {
4004-
*ppermission = sqlite3_column_int64(pstmt1, 1);
4005-
return TRUE;
4005+
*ppermission |= pstmt1.col_int64(1);
4006+
group_match = true;
40064007
}
40074008
}
4009+
if (group_match)
4010+
return TRUE;
40084011
pstmt1.finalize();
40094012
sqlite3_reset(pstmt);
40104013
sqlite3_bind_text(pstmt, 1, "default", -1, SQLITE_STATIC);

0 commit comments

Comments
 (0)