Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cli/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ def _usernamesToFile(usernames, args):
from sqlalchemy import insert
eid = makeEidEx(0, PrivateFIDs.IPMSUBTREE)
res = client.setFolderMembers(eid, usernames, Permissions.STOREACCESS_SET)
# Remove GROMOXSTOREOWNER legacy bit used by AAPI up to version 1.20
# from every member, for the same reason as in setUserStoreAccessMulti.
client.setFolderMembers(eid, [], Permissions.GROMOXSTOREOWNER)
if DB.minVersion(91):
UserSecondaryStores.query.filter(UserSecondaryStores.secondaryID == user.ID).delete(synchronize_session=False)
if len(usernames):
Expand Down
6 changes: 4 additions & 2 deletions endpoints/domain/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,10 @@ def setUserStoreAccessMulti(domainID, userID):
client = exmdb.user(user)
res = client.setFolderMembers(eid, [user.username for user in primary], Permissions.STOREACCESS_SET)
# Remove GROMOXSTOREOWNER legacy bit used by AAPI up to version 1.20.
for prim in primary:
client.setFolderMember(eid, prim.username, Permissions.GROMOXSTOREOWNER, client.REMOVE)
# An empty list clears the bit from every member, so a grant that is
# revoked by omission loses it as well - iterating over the requested
# users would leave the revoked ones a store owner.
client.setFolderMembers(eid, [], Permissions.GROMOXSTOREOWNER)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?????
This revokes permissions for all users

if DB.minVersion(91):
UserSecondaryStores.query.filter(UserSecondaryStores.secondaryID == user.ID).delete(synchronize_session=False)
if len(primary):
Expand Down