mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-12 23:37:15 +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:
1 parent
b910501afa
commit
861057f22f
2 files changed
+20
No files matched your search
@@ -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