mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-06 04:20:33 +00:00
file lost through rebasing
This commit is contained in:
committed by
Francis Lachapelle
parent
edbd661104
commit
3bf1224c9b
+25
-12
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSKeyValueCoding.h>
|
||||
@@ -80,10 +81,12 @@
|
||||
return defaultUserID;
|
||||
}
|
||||
|
||||
- (NSArray *) usersForObject
|
||||
- (id <WOActionResults>) usersForObjectAction
|
||||
{
|
||||
id <WOActionResults> result;
|
||||
NSEnumerator *aclsEnum;
|
||||
NSString *currentUID, *ownerLogin;
|
||||
NSDictionary *object;
|
||||
|
||||
if (!prepared)
|
||||
{
|
||||
@@ -96,13 +99,30 @@
|
||||
{
|
||||
if (!([currentUID isEqualToString: ownerLogin]
|
||||
|| [currentUID isEqualToString: defaultUserID]
|
||||
|| [currentUID isEqualToString: @"anonymous"]))
|
||||
[users addObjectUniquely: currentUID];
|
||||
|| [currentUID isEqualToString: @"anonymous"]))
|
||||
{
|
||||
// Set the current user in order to get information associated with it
|
||||
[self setCurrentUser: currentUID];
|
||||
|
||||
// Build the object associated with the key; currentUID
|
||||
object = [NSDictionary dictionaryWithObjectsAndKeys: currentUser, @"UID",
|
||||
[self currentUserClass], @"userClass",
|
||||
[self currentUserDisplayName], @"displayName",
|
||||
[NSNumber numberWithBool:[self currentUserIsSubscribed]], @"isSubscribed", nil];
|
||||
[users addObject:object];
|
||||
}
|
||||
}
|
||||
// Adding the Any authenticated user and the public access
|
||||
[users addObject:[NSDictionary dictionaryWithObjectsAndKeys: @"<default>", @"UID", @"Any authenticated user", @"displayName", @"public-user", @"userClass", nil]];
|
||||
if ([self isPublicAccessEnabled])
|
||||
[users addObject:[NSDictionary dictionaryWithObjectsAndKeys: @"anonymous", @"UID", @"Public access", @"displayName", @"public-user", @"userClass", nil]];
|
||||
prepared = YES;
|
||||
}
|
||||
|
||||
return users;
|
||||
result = [self responseWithStatus: 200
|
||||
andString: [users jsonRepresentation]];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void) setCurrentUser: (NSString *) newCurrentUser
|
||||
@@ -133,20 +153,13 @@
|
||||
return [um getFullEmailForUID: [self currentUser]];
|
||||
}
|
||||
|
||||
- (BOOL) canSubscribeUsers
|
||||
{
|
||||
return [[self clientObject]
|
||||
respondsToSelector: @selector (subscribeUserOrGroup:reallyDo:response:)];
|
||||
}
|
||||
|
||||
- (BOOL) currentUserIsSubscribed
|
||||
{
|
||||
SOGoGCSFolder *folder;
|
||||
|
||||
folder = [self clientObject];
|
||||
|
||||
return ([folder respondsToSelector: @selector (userIsSubscriber:)]
|
||||
&& [folder userIsSubscriber: currentUser]);
|
||||
return ([folder respondsToSelector: @selector (userIsSubscriber:)] && [folder userIsSubscriber: currentUser]);
|
||||
}
|
||||
|
||||
- (void) setUserUIDS: (NSString *) retainedUsers
|
||||
|
||||
Reference in New Issue
Block a user