mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-13 09:28:00 +00:00
Fix options availability in Contacts module
A user can edit/delete a card from a system addressbook if included in the "modifiers". Enable the delete/move options of the contextual menu in this case. Fixes #3342
This commit is contained in:
@@ -251,6 +251,24 @@ Class SOGoContactSourceFolderK, SOGoGCSFolderK;
|
||||
? @"available": @"unavailable");
|
||||
}
|
||||
|
||||
- (NSDictionary *) currentContactFolderCardRights
|
||||
{
|
||||
NSArray *roles;
|
||||
NSString *userLogin, *owner;
|
||||
BOOL objectEditor, objectEraser;
|
||||
|
||||
userLogin = [[context activeUser] login];
|
||||
owner = [currentFolder ownerInContext: context];
|
||||
roles = [currentFolder aclsForUser: userLogin];
|
||||
objectEditor = ([owner isEqualToString: userLogin] || [roles containsObject: SOGoRole_ObjectEditor]);
|
||||
objectEraser = ([owner isEqualToString: userLogin] || [roles containsObject: SOGoRole_ObjectEraser]);
|
||||
|
||||
return [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
(objectEditor? @"available": @"unavailable"), @"editing",
|
||||
(objectEraser? @"available": @"unavailable"), @"deleting",
|
||||
nil];
|
||||
}
|
||||
|
||||
- (NSString *) verticalDragHandleStyle
|
||||
{
|
||||
NSString *vertical;
|
||||
|
||||
Reference in New Issue
Block a user