diff options
author | stuconnolly <stuart02@gmail.com> | 2010-03-08 16:03:53 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-03-08 16:03:53 +0000 |
commit | 16a1da9e3eb7cc48c782e53142c4b94113239f1c (patch) | |
tree | e7c23b748160c4465416303764fdc767cae7f87a /Source/SPUserManager.m | |
parent | 9f94e9947d26dde767d3b1e49f6747d5c55db4d8 (diff) | |
download | sequelpro-16a1da9e3eb7cc48c782e53142c4b94113239f1c.tar.gz sequelpro-16a1da9e3eb7cc48c782e53142c4b94113239f1c.tar.bz2 sequelpro-16a1da9e3eb7cc48c782e53142c4b94113239f1c.zip |
Various user manager improvements including a new outline view contextual menu.
Diffstat (limited to 'Source/SPUserManager.m')
-rw-r--r-- | Source/SPUserManager.m | 23 |
1 files changed, 12 insertions, 11 deletions
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); |