diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPUserMO.m | 4 | ||||
-rw-r--r-- | Source/SPUserManager.h | 2 | ||||
-rw-r--r-- | Source/SPUserManager.m | 23 |
3 files changed, 14 insertions, 15 deletions
diff --git a/Source/SPUserMO.m b/Source/SPUserMO.m index 5c5bd40e..a9e9ddbb 100644 --- a/Source/SPUserMO.m +++ b/Source/SPUserMO.m @@ -50,10 +50,7 @@ { [self setValue:value forKey:@"host"]; } - - } - } - (void)addChildrenObject:(NSManagedObject *)value @@ -78,4 +75,5 @@ [changedObjects release]; } + @end diff --git a/Source/SPUserManager.h b/Source/SPUserManager.h index 172fbdde..88f88ee6 100644 --- a/Source/SPUserManager.h +++ b/Source/SPUserManager.h @@ -97,6 +97,6 @@ - (BOOL)grantPrivilegesToUser:(NSManagedObject *)user; - (BOOL)grantDbPrivilegesWithPrivilege:(NSManagedObject *)user; - - (NSArray *)treeSortDescriptors; + @end diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index c9f41a21..317ca848 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -49,9 +49,6 @@ - (void)_setSchemaPrivValues:(NSArray *)objects enabled:(BOOL)enabled; - (void) _initializeAvailablePrivs; - - - @end @implementation SPUserManager @@ -65,7 +62,7 @@ @synthesize grantedSchemaPrivs; @synthesize availablePrivs; --(id)init +- (id)init { if ((self = [super initWithWindowNibName:@"UserManagerView"])) { @@ -82,11 +79,11 @@ @"Replication_client_priv", @"Repl_client_priv", nil]; } + schemas = [[NSMutableArray alloc] init]; availablePrivs = [[NSMutableArray alloc] init]; grantedSchemaPrivs = [[NSMutableArray alloc] init]; - return self; } @@ -247,7 +244,8 @@ [treeController rearrangeObjects]; } -- (void) _initializeAvailablePrivs { +- (void) _initializeAvailablePrivs +{ // Initialize available privileges NSManagedObjectContext *moc = self.managedObjectContext; NSEntityDescription *privEntityDescription = [NSEntityDescription entityForName:@"Privileges" @@ -525,12 +523,14 @@ } } + return YES; } - (NSArray *)treeSortDescriptors { NSSortDescriptor *descriptor = [[[NSSortDescriptor alloc] initWithKey:@"displayName" ascending:YES] autorelease]; + return [NSArray arrayWithObject:descriptor]; } @@ -787,7 +787,8 @@ { return ([[treeController selectedObjects] count] > 0); } - return TRUE; + + return YES; } - (void)_selectParentFromSelection @@ -996,7 +997,7 @@ if ([grantPrivileges count] > 0) { NSString *grantStatement = [NSString stringWithFormat:@"GRANT %@ ON %@.* TO %@@%@", - [grantPrivileges componentsJoinedByCommas], + [[grantPrivileges componentsJoinedByCommas] uppercaseString], dbName, [[schemaPriv valueForKeyPath:@"user.parent.user"] tickQuotedString], [[schemaPriv valueForKeyPath:@"user.host"] tickQuotedString]]; @@ -1009,7 +1010,7 @@ if ([revokePrivileges count] > 0) { NSString *revokeStatement = [NSString stringWithFormat:@"REVOKE %@ ON %@.* FROM %@@%@", - [revokePrivileges componentsJoinedByCommas], + [[revokePrivileges componentsJoinedByCommas] uppercaseString], dbName, [[schemaPriv valueForKeyPath:@"user.parent.user"] tickQuotedString], [[schemaPriv valueForKeyPath:@"user.host"] tickQuotedString]]; @@ -1051,7 +1052,7 @@ if ([grantPrivileges count] > 0) { NSString *grantStatement = [NSString stringWithFormat:@"GRANT %@ ON *.* TO %@@%@", - [grantPrivileges componentsJoinedByCommas], + [[grantPrivileges componentsJoinedByCommas] uppercaseString], [[[user parent] valueForKey:@"user"] tickQuotedString], [[user valueForKey:@"host"] tickQuotedString]]; DLog(@"%@", grantStatement); @@ -1063,7 +1064,7 @@ if ([revokePrivileges count] > 0) { NSString *revokeStatement = [NSString stringWithFormat:@"REVOKE %@ ON *.* FROM %@@%@", - [revokePrivileges componentsJoinedByCommas], + [[revokePrivileges componentsJoinedByCommas] uppercaseString], [[[user parent] valueForKey:@"user"] tickQuotedString], [[user valueForKey:@"host"] tickQuotedString]]; DLog(@"%@", revokeStatement); |