aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Interfaces/English.lproj/UserManagerView.xib1168
-rw-r--r--Source/SPUserManager.h28
-rw-r--r--Source/SPUserManager.m355
-rw-r--r--Source/SPUserManager.xcdatamodel/elementsbin62017 -> 127988 bytes
-rw-r--r--Source/SPUserManager.xcdatamodel/layoutbin6447 -> 9663 bytes
-rw-r--r--Source/TableDocument.m2
6 files changed, 1529 insertions, 24 deletions
diff --git a/Interfaces/English.lproj/UserManagerView.xib b/Interfaces/English.lproj/UserManagerView.xib
index 607f0bfd..99daff3c 100644
--- a/Interfaces/English.lproj/UserManagerView.xib
+++ b/Interfaces/English.lproj/UserManagerView.xib
@@ -21,12 +21,12 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="27"/>
+ <integer value="579"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>com.brandonwalkin.BWToolkit</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.brandonwalkin.BWToolkit</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -56,7 +56,7 @@
<string key="NSWindowTitle">User Managment</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
- <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSWindowContentMinSize">{752, 506}</string>
<object class="NSView" key="NSWindowView" id="846307432">
<reference key="NSNextResponder"/>
@@ -122,7 +122,7 @@
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
</object>
- <object class="NSColor" key="NSTextColor">
+ <object class="NSColor" key="NSTextColor" id="579753059">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">headerTextColor</string>
@@ -148,7 +148,7 @@
<string key="NSColorName">controlBackgroundColor</string>
<object class="NSColor" key="NSColor" id="246134814">
<int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC42NjY2NjY2ODY1AA</bytes>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor" id="315534074">
@@ -180,7 +180,7 @@
<bytes key="NSRGB">MC44MzkyMTU2OTU5IDAuODY2NjY2Njc0NiAwLjg5ODAzOTIyMTgAA</bytes>
</object>
</object>
- <object class="NSColor" key="NSGridColor">
+ <object class="NSColor" key="NSGridColor" id="114043488">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">gridColor</string>
@@ -384,6 +384,30 @@
<int key="NSArrowPosition">2</int>
</object>
</object>
+ <object class="BWAnchoredButton" id="262272135">
+ <reference key="NSNextResponder" ref="623571747"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{92, -1}, {32, 24}}</string>
+ <reference key="NSSuperview" ref="623571747"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="BWAnchoredButtonCell" key="NSCell" id="956168530">
+ <int key="NSCellFlags">604110336</int>
+ <int key="NSCellFlags2">134348800</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="262272135"/>
+ <int key="NSButtonFlags">-2033958657</int>
+ <int key="NSButtonFlags2">163</int>
+ <object class="NSCustomResource" key="NSNormalImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSRefreshTemplate</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
</object>
<string key="NSFrameSize">{194, 23}</string>
<reference key="NSSuperview" ref="490248567"/>
@@ -412,7 +436,7 @@
<object class="NSTabViewItem" id="820796939">
<string key="NSIdentifier">General</string>
<object class="NSView" key="NSView" id="143215913">
- <reference key="NSNextResponder" ref="716372522"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -541,7 +565,6 @@
</object>
</object>
<string key="NSFrame">{{10, 33}, {480, 414}}</string>
- <reference key="NSSuperview" ref="716372522"/>
</object>
<string key="NSLabel">General</string>
<reference key="NSColor" ref="409859189"/>
@@ -1642,14 +1665,470 @@
<reference key="NSColor" ref="409859189"/>
<reference key="NSTabView" ref="716372522"/>
</object>
+ <object class="NSTabViewItem" id="487249930">
+ <string key="NSIdentifier">Schema Privileges</string>
+ <object class="NSView" key="NSView" id="601698335">
+ <reference key="NSNextResponder" ref="716372522"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSScrollView" id="307214944">
+ <reference key="NSNextResponder" ref="601698335"/>
+ <int key="NSvFlags">268</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSClipView" id="380397569">
+ <reference key="NSNextResponder" ref="307214944"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTableView" id="280739950">
+ <reference key="NSNextResponder" ref="380397569"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{104, 363}</string>
+ <reference key="NSSuperview" ref="380397569"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTableHeaderView" key="NSHeaderView" id="406943647">
+ <reference key="NSNextResponder" ref="999658386"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{104, 17}</string>
+ <reference key="NSSuperview" ref="999658386"/>
+ <reference key="NSTableView" ref="280739950"/>
+ </object>
+ <object class="_NSCornerView" key="NSCornerView" id="15656085">
+ <reference key="NSNextResponder" ref="307214944"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{224, 0}, {16, 17}}</string>
+ <reference key="NSSuperview" ref="307214944"/>
+ </object>
+ <object class="NSMutableArray" key="NSTableColumns">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTableColumn" id="919609640">
+ <string key="NSIdentifier">Schemas</string>
+ <double key="NSWidth">101</double>
+ <double key="NSMinWidth">40</double>
+ <double key="NSMaxWidth">1000</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">75628096</int>
+ <int key="NSCellFlags2">2048</int>
+ <string key="NSContents">Schemas</string>
+ <reference key="NSSupport" ref="26"/>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
+ </object>
+ <reference key="NSTextColor" ref="579753059"/>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell" id="1460002">
+ <int key="NSCellFlags">337772096</int>
+ <int key="NSCellFlags2">2048</int>
+ <string key="NSContents">Text Cell</string>
+ <reference key="NSSupport" ref="746597359"/>
+ <reference key="NSControlView" ref="280739950"/>
+ <reference key="NSBackgroundColor" ref="898983655"/>
+ <reference key="NSTextColor" ref="315534074"/>
+ </object>
+ <int key="NSResizingMask">1</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <reference key="NSTableView" ref="280739950"/>
+ </object>
+ </object>
+ <double key="NSIntercellSpacingWidth">3</double>
+ <double key="NSIntercellSpacingHeight">2</double>
+ <reference key="NSBackgroundColor" ref="888720323"/>
+ <reference key="NSGridColor" ref="114043488"/>
+ <double key="NSRowHeight">17</double>
+ <int key="NSTvFlags">-700448768</int>
+ <reference key="NSDelegate"/>
+ <reference key="NSDataSource"/>
+ <int key="NSColumnAutoresizingStyle">4</int>
+ <int key="NSDraggingSourceMaskForLocal">15</int>
+ <int key="NSDraggingSourceMaskForNonLocal">0</int>
+ <bool key="NSAllowsTypeSelect">YES</bool>
+ <int key="NSTableViewDraggingDestinationStyle">0</int>
+ </object>
+ </object>
+ <string key="NSFrame">{{1, 17}, {104, 363}}</string>
+ <reference key="NSSuperview" ref="307214944"/>
+ <reference key="NSNextKeyView" ref="280739950"/>
+ <reference key="NSDocView" ref="280739950"/>
+ <reference key="NSBGColor" ref="898983655"/>
+ <int key="NScvFlags">4</int>
+ </object>
+ <object class="NSScroller" id="304497597">
+ <reference key="NSNextResponder" ref="307214944"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{224, 17}, {15, 102}}</string>
+ <reference key="NSSuperview" ref="307214944"/>
+ <reference key="NSTarget" ref="307214944"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSCurValue">37</double>
+ <double key="NSPercent">0.1947367936372757</double>
+ </object>
+ <object class="NSScroller" id="1067950228">
+ <reference key="NSNextResponder" ref="307214944"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{1, 119}, {223, 15}}</string>
+ <reference key="NSSuperview" ref="307214944"/>
+ <int key="NSsFlags">1</int>
+ <reference key="NSTarget" ref="307214944"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSPercent">0.57142859697341919</double>
+ </object>
+ <object class="NSClipView" id="999658386">
+ <reference key="NSNextResponder" ref="307214944"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="406943647"/>
+ </object>
+ <string key="NSFrame">{{1, 0}, {104, 17}}</string>
+ <reference key="NSSuperview" ref="307214944"/>
+ <reference key="NSNextKeyView" ref="406943647"/>
+ <reference key="NSDocView" ref="406943647"/>
+ <reference key="NSBGColor" ref="898983655"/>
+ <int key="NScvFlags">4</int>
+ </object>
+ <reference ref="15656085"/>
+ </object>
+ <string key="NSFrame">{{17, 17}, {106, 381}}</string>
+ <reference key="NSSuperview" ref="601698335"/>
+ <reference key="NSNextKeyView" ref="380397569"/>
+ <int key="NSsFlags">562</int>
+ <reference key="NSVScroller" ref="304497597"/>
+ <reference key="NSHScroller" ref="1067950228"/>
+ <reference key="NSContentView" ref="380397569"/>
+ <reference key="NSHeaderClipView" ref="999658386"/>
+ <reference key="NSCornerView" ref="15656085"/>
+ <bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
+ </object>
+ <object class="NSScrollView" id="728294866">
+ <reference key="NSNextResponder" ref="601698335"/>
+ <int key="NSvFlags">268</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSClipView" id="239762482">
+ <reference key="NSNextResponder" ref="728294866"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTableView" id="64638447">
+ <reference key="NSNextResponder" ref="239762482"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{104, 363}</string>
+ <reference key="NSSuperview" ref="239762482"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTableHeaderView" key="NSHeaderView" id="599931188">
+ <reference key="NSNextResponder" ref="2173"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{104, 17}</string>
+ <reference key="NSSuperview" ref="2173"/>
+ <reference key="NSTableView" ref="64638447"/>
+ </object>
+ <object class="_NSCornerView" key="NSCornerView" id="563503371">
+ <reference key="NSNextResponder" ref="728294866"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{224, 0}, {16, 17}}</string>
+ <reference key="NSSuperview" ref="728294866"/>
+ </object>
+ <object class="NSMutableArray" key="NSTableColumns">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTableColumn" id="1048567781">
+ <string key="NSIdentifier">Granted Privilege</string>
+ <double key="NSWidth">101</double>
+ <double key="NSMinWidth">40</double>
+ <double key="NSMaxWidth">1000</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">75628096</int>
+ <int key="NSCellFlags2">2048</int>
+ <string key="NSContents">Granted Privilege</string>
+ <reference key="NSSupport" ref="26"/>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
+ </object>
+ <reference key="NSTextColor" ref="579753059"/>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell" id="1033652128">
+ <int key="NSCellFlags">337772096</int>
+ <int key="NSCellFlags2">2048</int>
+ <string key="NSContents">Text Cell</string>
+ <reference key="NSSupport" ref="746597359"/>
+ <reference key="NSControlView" ref="64638447"/>
+ <reference key="NSBackgroundColor" ref="898983655"/>
+ <reference key="NSTextColor" ref="315534074"/>
+ </object>
+ <int key="NSResizingMask">1</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <reference key="NSTableView" ref="64638447"/>
+ </object>
+ </object>
+ <double key="NSIntercellSpacingWidth">3</double>
+ <double key="NSIntercellSpacingHeight">2</double>
+ <reference key="NSBackgroundColor" ref="898983655"/>
+ <reference key="NSGridColor" ref="114043488"/>
+ <double key="NSRowHeight">17</double>
+ <int key="NSTvFlags">1581252608</int>
+ <reference key="NSDelegate"/>
+ <reference key="NSDataSource"/>
+ <int key="NSColumnAutoresizingStyle">4</int>
+ <int key="NSDraggingSourceMaskForLocal">15</int>
+ <int key="NSDraggingSourceMaskForNonLocal">0</int>
+ <bool key="NSAllowsTypeSelect">YES</bool>
+ <int key="NSTableViewDraggingDestinationStyle">0</int>
+ </object>
+ </object>
+ <string key="NSFrame">{{1, 17}, {104, 363}}</string>
+ <reference key="NSSuperview" ref="728294866"/>
+ <reference key="NSNextKeyView" ref="64638447"/>
+ <reference key="NSDocView" ref="64638447"/>
+ <reference key="NSBGColor" ref="898983655"/>
+ <int key="NScvFlags">4</int>
+ </object>
+ <object class="NSScroller" id="210192488">
+ <reference key="NSNextResponder" ref="728294866"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{224, 17}, {15, 102}}</string>
+ <reference key="NSSuperview" ref="728294866"/>
+ <reference key="NSTarget" ref="728294866"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSPercent">0.99725274725274726</double>
+ </object>
+ <object class="NSScroller" id="253008686">
+ <reference key="NSNextResponder" ref="728294866"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{1, 119}, {223, 15}}</string>
+ <reference key="NSSuperview" ref="728294866"/>
+ <int key="NSsFlags">1</int>
+ <reference key="NSTarget" ref="728294866"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSPercent">0.99047619047619051</double>
+ </object>
+ <object class="NSClipView" id="2173">
+ <reference key="NSNextResponder" ref="728294866"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="599931188"/>
+ </object>
+ <string key="NSFrame">{{1, 0}, {104, 17}}</string>
+ <reference key="NSSuperview" ref="728294866"/>
+ <reference key="NSNextKeyView" ref="599931188"/>
+ <reference key="NSDocView" ref="599931188"/>
+ <reference key="NSBGColor" ref="898983655"/>
+ <int key="NScvFlags">4</int>
+ </object>
+ <reference ref="563503371"/>
+ </object>
+ <string key="NSFrame">{{160, 17}, {106, 381}}</string>
+ <reference key="NSSuperview" ref="601698335"/>
+ <reference key="NSNextKeyView" ref="239762482"/>
+ <int key="NSsFlags">562</int>
+ <reference key="NSVScroller" ref="210192488"/>
+ <reference key="NSHScroller" ref="253008686"/>
+ <reference key="NSContentView" ref="239762482"/>
+ <reference key="NSHeaderClipView" ref="2173"/>
+ <reference key="NSCornerView" ref="563503371"/>
+ <bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
+ </object>
+ <object class="NSScrollView" id="898351365">
+ <reference key="NSNextResponder" ref="601698335"/>
+ <int key="NSvFlags">268</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSClipView" id="728383964">
+ <reference key="NSNextResponder" ref="898351365"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTableView" id="443904239">
+ <reference key="NSNextResponder" ref="728383964"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{104, 363}</string>
+ <reference key="NSSuperview" ref="728383964"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTableHeaderView" key="NSHeaderView" id="120612996">
+ <reference key="NSNextResponder" ref="226879331"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{104, 17}</string>
+ <reference key="NSSuperview" ref="226879331"/>
+ <reference key="NSTableView" ref="443904239"/>
+ </object>
+ <object class="_NSCornerView" key="NSCornerView" id="755942269">
+ <reference key="NSNextResponder" ref="898351365"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{224, 0}, {16, 17}}</string>
+ <reference key="NSSuperview" ref="898351365"/>
+ </object>
+ <object class="NSMutableArray" key="NSTableColumns">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTableColumn" id="408402649">
+ <string key="NSIdentifier">Available Privilige</string>
+ <double key="NSWidth">101</double>
+ <double key="NSMinWidth">40</double>
+ <double key="NSMaxWidth">1000</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">75628096</int>
+ <int key="NSCellFlags2">2048</int>
+ <string key="NSContents">Available Privilige</string>
+ <reference key="NSSupport" ref="26"/>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
+ </object>
+ <reference key="NSTextColor" ref="579753059"/>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell" id="1064222866">
+ <int key="NSCellFlags">337772096</int>
+ <int key="NSCellFlags2">2048</int>
+ <string key="NSContents">Text Cell</string>
+ <reference key="NSSupport" ref="746597359"/>
+ <reference key="NSControlView" ref="443904239"/>
+ <reference key="NSBackgroundColor" ref="898983655"/>
+ <reference key="NSTextColor" ref="315534074"/>
+ </object>
+ <int key="NSResizingMask">1</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <reference key="NSTableView" ref="443904239"/>
+ </object>
+ </object>
+ <double key="NSIntercellSpacingWidth">3</double>
+ <double key="NSIntercellSpacingHeight">2</double>
+ <reference key="NSBackgroundColor" ref="888720323"/>
+ <reference key="NSGridColor" ref="114043488"/>
+ <double key="NSRowHeight">17</double>
+ <int key="NSTvFlags">1581252608</int>
+ <reference key="NSDelegate"/>
+ <reference key="NSDataSource"/>
+ <int key="NSColumnAutoresizingStyle">4</int>
+ <int key="NSDraggingSourceMaskForLocal">15</int>
+ <int key="NSDraggingSourceMaskForNonLocal">0</int>
+ <bool key="NSAllowsTypeSelect">YES</bool>
+ <int key="NSTableViewDraggingDestinationStyle">0</int>
+ </object>
+ </object>
+ <string key="NSFrame">{{1, 17}, {104, 363}}</string>
+ <reference key="NSSuperview" ref="898351365"/>
+ <reference key="NSNextKeyView" ref="443904239"/>
+ <reference key="NSDocView" ref="443904239"/>
+ <reference key="NSBGColor" ref="898983655"/>
+ <int key="NScvFlags">4</int>
+ </object>
+ <object class="NSScroller" id="939829514">
+ <reference key="NSNextResponder" ref="898351365"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{224, 17}, {15, 102}}</string>
+ <reference key="NSSuperview" ref="898351365"/>
+ <reference key="NSTarget" ref="898351365"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSCurValue">37</double>
+ <double key="NSPercent">0.1947367936372757</double>
+ </object>
+ <object class="NSScroller" id="1063461866">
+ <reference key="NSNextResponder" ref="898351365"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{1, 119}, {223, 15}}</string>
+ <reference key="NSSuperview" ref="898351365"/>
+ <int key="NSsFlags">1</int>
+ <reference key="NSTarget" ref="898351365"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSPercent">0.57142859697341919</double>
+ </object>
+ <object class="NSClipView" id="226879331">
+ <reference key="NSNextResponder" ref="898351365"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="120612996"/>
+ </object>
+ <string key="NSFrame">{{1, 0}, {104, 17}}</string>
+ <reference key="NSSuperview" ref="898351365"/>
+ <reference key="NSNextKeyView" ref="120612996"/>
+ <reference key="NSDocView" ref="120612996"/>
+ <reference key="NSBGColor" ref="898983655"/>
+ <int key="NScvFlags">4</int>
+ </object>
+ <reference ref="755942269"/>
+ </object>
+ <string key="NSFrame">{{357, 17}, {106, 381}}</string>
+ <reference key="NSSuperview" ref="601698335"/>
+ <reference key="NSNextKeyView" ref="728383964"/>
+ <int key="NSsFlags">562</int>
+ <reference key="NSVScroller" ref="939829514"/>
+ <reference key="NSHScroller" ref="1063461866"/>
+ <reference key="NSContentView" ref="728383964"/>
+ <reference key="NSHeaderClipView" ref="226879331"/>
+ <reference key="NSCornerView" ref="755942269"/>
+ <bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
+ </object>
+ <object class="NSButton" id="763888467">
+ <reference key="NSNextResponder" ref="601698335"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{288, 275}, {38, 29}}</string>
+ <reference key="NSSuperview" ref="601698335"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="402609054">
+ <int key="NSCellFlags">604110336</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents"/>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">14</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <reference key="NSControlView" ref="763888467"/>
+ <int key="NSButtonFlags">-2042347265</int>
+ <int key="NSButtonFlags2">134</int>
+ <object class="NSCustomResource" key="NSNormalImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">button_left</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ </object>
+ <object class="NSButton" id="391997741">
+ <reference key="NSNextResponder" ref="601698335"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{288, 217}, {38, 29}}</string>
+ <reference key="NSSuperview" ref="601698335"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="264407900">
+ <int key="NSCellFlags">604110336</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="746597359"/>
+ <reference key="NSControlView" ref="391997741"/>
+ <int key="NSButtonFlags">-2042347265</int>
+ <int key="NSButtonFlags2">134</int>
+ <object class="NSCustomResource" key="NSNormalImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">button_right</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrame">{{10, 33}, {480, 414}}</string>
+ <reference key="NSSuperview" ref="716372522"/>
+ </object>
+ <string key="NSLabel">Schema Privileges</string>
+ <reference key="NSColor" ref="409859189"/>
+ <reference key="NSTabView" ref="716372522"/>
+ </object>
</object>
- <reference key="NSSelectedTabViewItem" ref="820796939"/>
+ <reference key="NSSelectedTabViewItem" ref="487249930"/>
<reference key="NSFont" ref="746597359"/>
<int key="NSTvFlags">0</int>
<bool key="NSDrawsBackground">YES</bool>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="143215913"/>
+ <reference ref="601698335"/>
</object>
</object>
<object class="NSButton" id="445730006">
@@ -1711,7 +2190,7 @@
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMinSize">{752, 528}</string>
- <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
<object class="NSTreeController" id="889422316">
<object class="NSMutableArray" key="NSDeclaredKeys">
@@ -1796,6 +2275,7 @@
<string>select_priv.isOptional</string>
<string>trigger_priv</string>
<string>event_priv</string>
+ <string>name</string>
</object>
<string key="NSObjectClassName">SPUserItem</string>
<bool key="NSEditable">YES</bool>
@@ -1838,6 +2318,43 @@
<object class="NSCustomObject" id="674959820">
<string key="NSClassName">NSMutableDictionary</string>
</object>
+ <object class="NSArrayController" id="468815722">
+ <object class="NSMutableArray" key="NSDeclaredKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>Database</string>
+ </object>
+ <bool key="NSEditable">YES</bool>
+ <bool key="NSAutomaticallyPreparesContent">YES</bool>
+ <object class="_NSManagedProxy" key="_NSManagedProxy"/>
+ <bool key="NSFilterRestrictsInsertion">YES</bool>
+ <bool key="NSClearsFilterPredicateOnInsertion">YES</bool>
+ <bool key="NSAutomaticallyRearrangesObjects">YES</bool>
+ </object>
+ <object class="NSArrayController" id="794463874">
+ <object class="NSMutableArray" key="NSDeclaredKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>displayName</string>
+ </object>
+ <bool key="NSEditable">YES</bool>
+ <object class="_NSManagedProxy" key="_NSManagedProxy"/>
+ <bool key="NSFilterRestrictsInsertion">YES</bool>
+ <bool key="NSClearsFilterPredicateOnInsertion">YES</bool>
+ <bool key="NSAutomaticallyRearrangesObjects">YES</bool>
+ </object>
+ <object class="NSArrayController" id="993695076">
+ <object class="NSMutableArray" key="NSDeclaredKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>displayName</string>
+ </object>
+ <bool key="NSEditable">YES</bool>
+ <bool key="NSAutomaticallyPreparesContent">YES</bool>
+ <object class="_NSManagedProxy" key="_NSManagedProxy">
+ <string key="NSEntityName">Privileges</string>
+ </object>
+ <bool key="NSFilterRestrictsInsertion">YES</bool>
+ <bool key="NSClearsFilterPredicateOnInsertion">YES</bool>
+ <bool key="NSAutomaticallyRearrangesObjects">YES</bool>
+ </object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
@@ -3205,6 +3722,246 @@
</object>
<int key="connectionID">742</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">availableController</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="993695076"/>
+ </object>
+ <int key="connectionID">789</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">grantedController</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="794463874"/>
+ </object>
+ <int key="connectionID">790</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">schemaController</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="468815722"/>
+ </object>
+ <int key="connectionID">791</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">addSchemaPriv:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="763888467"/>
+ </object>
+ <int key="connectionID">792</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">removeSchemaPriv:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="391997741"/>
+ </object>
+ <int key="connectionID">793</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">contentArray: grantedSchemaPrivs</string>
+ <reference key="source" ref="794463874"/>
+ <reference key="destination" ref="1001"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="794463874"/>
+ <reference key="NSDestination" ref="1001"/>
+ <string key="NSLabel">contentArray: grantedSchemaPrivs</string>
+ <string key="NSBinding">contentArray</string>
+ <string key="NSKeyPath">grantedSchemaPrivs</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">800</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: arrangedObjects.Database</string>
+ <reference key="source" ref="919609640"/>
+ <reference key="destination" ref="468815722"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="919609640"/>
+ <reference key="NSDestination" ref="468815722"/>
+ <string key="NSLabel">value: arrangedObjects.Database</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">arrangedObjects.Database</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">806</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">contentArray: schemas</string>
+ <reference key="source" ref="468815722"/>
+ <reference key="destination" ref="1001"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="468815722"/>
+ <reference key="NSDestination" ref="1001"/>
+ <string key="NSLabel">contentArray: schemas</string>
+ <string key="NSBinding">contentArray</string>
+ <string key="NSKeyPath">schemas</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">809</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">dataSource</string>
+ <reference key="source" ref="280739950"/>
+ <reference key="destination" ref="468815722"/>
+ </object>
+ <int key="connectionID">810</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">contentArray: availablePrivs</string>
+ <reference key="source" ref="993695076"/>
+ <reference key="destination" ref="1001"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="993695076"/>
+ <reference key="NSDestination" ref="1001"/>
+ <string key="NSLabel">contentArray: availablePrivs</string>
+ <string key="NSBinding">contentArray</string>
+ <string key="NSKeyPath">availablePrivs</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">821</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="280739950"/>
+ <reference key="destination" ref="1001"/>
+ </object>
+ <int key="connectionID">826</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">schemasTableView</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="280739950"/>
+ </object>
+ <int key="connectionID">827</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">dataSource</string>
+ <reference key="source" ref="64638447"/>
+ <reference key="destination" ref="794463874"/>
+ </object>
+ <int key="connectionID">848</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="64638447"/>
+ <reference key="destination" ref="1001"/>
+ </object>
+ <int key="connectionID">849</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">dataSource</string>
+ <reference key="source" ref="443904239"/>
+ <reference key="destination" ref="993695076"/>
+ </object>
+ <int key="connectionID">850</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="443904239"/>
+ <reference key="destination" ref="1001"/>
+ </object>
+ <int key="connectionID">851</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">grantedTableView</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="64638447"/>
+ </object>
+ <int key="connectionID">854</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">availableTableView</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="443904239"/>
+ </object>
+ <int key="connectionID">855</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">refresh:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="262272135"/>
+ </object>
+ <int key="connectionID">860</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: arrangedObjects.displayName</string>
+ <reference key="source" ref="1048567781"/>
+ <reference key="destination" ref="794463874"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="1048567781"/>
+ <reference key="NSDestination" ref="794463874"/>
+ <string key="NSLabel">value: arrangedObjects.displayName</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">arrangedObjects.displayName</string>
+ <object class="NSDictionary" key="NSOptions">
+ <string key="NS.key.0">NSConditionallySetsEditable</string>
+ <boolean value="YES" key="NS.object.0"/>
+ </object>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">861</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: arrangedObjects.displayName</string>
+ <reference key="source" ref="408402649"/>
+ <reference key="destination" ref="993695076"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="408402649"/>
+ <reference key="NSDestination" ref="993695076"/>
+ <string key="NSLabel">value: arrangedObjects.displayName</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">arrangedObjects.displayName</string>
+ <object class="NSDictionary" key="NSOptions">
+ <string key="NS.key.0">NSConditionallySetsEditable</string>
+ <boolean value="YES" key="NS.object.0"/>
+ </object>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">866</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">addSchemaPrivButton</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="763888467"/>
+ </object>
+ <int key="connectionID">883</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">removeSchemaPrivButton</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="391997741"/>
+ </object>
+ <int key="connectionID">884</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -3335,6 +4092,7 @@
<reference ref="100435394"/>
<reference ref="254382996"/>
<reference ref="112862365"/>
+ <reference ref="262272135"/>
</object>
<reference key="parent" ref="490248567"/>
</object>
@@ -3435,6 +4193,7 @@
<reference ref="820796939"/>
<reference ref="285628164"/>
<reference ref="1024639412"/>
+ <reference ref="487249930"/>
</object>
<reference key="parent" ref="755335467"/>
</object>
@@ -4150,6 +4909,238 @@
<reference key="object" ref="1067684076"/>
<reference key="parent" ref="335568650"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">743</int>
+ <reference key="object" ref="487249930"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="601698335"/>
+ </object>
+ <reference key="parent" ref="716372522"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">744</int>
+ <reference key="object" ref="601698335"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="307214944"/>
+ <reference ref="728294866"/>
+ <reference ref="898351365"/>
+ <reference ref="391997741"/>
+ <reference ref="763888467"/>
+ </object>
+ <reference key="parent" ref="487249930"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">745</int>
+ <reference key="object" ref="307214944"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="304497597"/>
+ <reference ref="1067950228"/>
+ <reference ref="280739950"/>
+ <reference ref="406943647"/>
+ </object>
+ <reference key="parent" ref="601698335"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">746</int>
+ <reference key="object" ref="304497597"/>
+ <reference key="parent" ref="307214944"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">747</int>
+ <reference key="object" ref="1067950228"/>
+ <reference key="parent" ref="307214944"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">748</int>
+ <reference key="object" ref="280739950"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="919609640"/>
+ </object>
+ <reference key="parent" ref="307214944"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">749</int>
+ <reference key="object" ref="406943647"/>
+ <reference key="parent" ref="307214944"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">750</int>
+ <reference key="object" ref="919609640"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1460002"/>
+ </object>
+ <reference key="parent" ref="280739950"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">753</int>
+ <reference key="object" ref="1460002"/>
+ <reference key="parent" ref="919609640"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">768</int>
+ <reference key="object" ref="728294866"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="64638447"/>
+ <reference ref="253008686"/>
+ <reference ref="210192488"/>
+ <reference ref="599931188"/>
+ </object>
+ <reference key="parent" ref="601698335"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">770</int>
+ <reference key="object" ref="64638447"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1048567781"/>
+ </object>
+ <reference key="parent" ref="728294866"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">771</int>
+ <reference key="object" ref="253008686"/>
+ <reference key="parent" ref="728294866"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">772</int>
+ <reference key="object" ref="210192488"/>
+ <reference key="parent" ref="728294866"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">773</int>
+ <reference key="object" ref="1048567781"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1033652128"/>
+ </object>
+ <reference key="parent" ref="64638447"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">774</int>
+ <reference key="object" ref="1033652128"/>
+ <reference key="parent" ref="1048567781"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">775</int>
+ <reference key="object" ref="898351365"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="120612996"/>
+ <reference ref="443904239"/>
+ <reference ref="1063461866"/>
+ <reference ref="939829514"/>
+ </object>
+ <reference key="parent" ref="601698335"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">776</int>
+ <reference key="object" ref="120612996"/>
+ <reference key="parent" ref="898351365"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">777</int>
+ <reference key="object" ref="443904239"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="408402649"/>
+ </object>
+ <reference key="parent" ref="898351365"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">778</int>
+ <reference key="object" ref="1063461866"/>
+ <reference key="parent" ref="898351365"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">779</int>
+ <reference key="object" ref="939829514"/>
+ <reference key="parent" ref="898351365"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">780</int>
+ <reference key="object" ref="408402649"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1064222866"/>
+ </object>
+ <reference key="parent" ref="443904239"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">781</int>
+ <reference key="object" ref="1064222866"/>
+ <reference key="parent" ref="408402649"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">784</int>
+ <reference key="object" ref="391997741"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="264407900"/>
+ </object>
+ <reference key="parent" ref="601698335"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">785</int>
+ <reference key="object" ref="264407900"/>
+ <reference key="parent" ref="391997741"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">782</int>
+ <reference key="object" ref="763888467"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="402609054"/>
+ </object>
+ <reference key="parent" ref="601698335"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">783</int>
+ <reference key="object" ref="402609054"/>
+ <reference key="parent" ref="763888467"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">786</int>
+ <reference key="object" ref="468815722"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Schemas</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">787</int>
+ <reference key="object" ref="794463874"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">GrantedPrivs</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">788</int>
+ <reference key="object" ref="993695076"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">AvailablePrivs</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">858</int>
+ <reference key="object" ref="262272135"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="956168530"/>
+ </object>
+ <reference key="parent" ref="623571747"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">859</int>
+ <reference key="object" ref="956168530"/>
+ <reference key="parent" ref="262272135"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">867</int>
+ <reference key="object" ref="599931188"/>
+ <reference key="parent" ref="728294866"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -4291,6 +5282,35 @@
<string>720.IBPluginDependency</string>
<string>725.IBPluginDependency</string>
<string>726.IBPluginDependency</string>
+ <string>745.IBPluginDependency</string>
+ <string>746.IBPluginDependency</string>
+ <string>747.IBPluginDependency</string>
+ <string>748.IBPluginDependency</string>
+ <string>749.IBPluginDependency</string>
+ <string>750.IBPluginDependency</string>
+ <string>753.IBPluginDependency</string>
+ <string>768.IBPluginDependency</string>
+ <string>770.IBPluginDependency</string>
+ <string>771.IBPluginDependency</string>
+ <string>772.IBPluginDependency</string>
+ <string>773.IBPluginDependency</string>
+ <string>774.IBPluginDependency</string>
+ <string>775.IBPluginDependency</string>
+ <string>776.IBPluginDependency</string>
+ <string>777.IBPluginDependency</string>
+ <string>778.IBPluginDependency</string>
+ <string>779.IBPluginDependency</string>
+ <string>780.IBPluginDependency</string>
+ <string>781.IBPluginDependency</string>
+ <string>782.IBPluginDependency</string>
+ <string>783.IBPluginDependency</string>
+ <string>784.IBPluginDependency</string>
+ <string>785.IBPluginDependency</string>
+ <string>786.IBPluginDependency</string>
+ <string>787.IBPluginDependency</string>
+ <string>788.IBPluginDependency</string>
+ <string>858.IBPluginDependency</string>
+ <string>859.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -4319,11 +5339,11 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{59, 250}, {752, 506}}</string>
+ <string>{{59, 347}, {752, 506}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO"/>
<boolean value="NO"/>
- <string>{{59, 250}, {752, 506}}</string>
+ <string>{{59, 347}, {752, 506}}</string>
<boolean value="NO"/>
<boolean value="YES"/>
<string>{752, 506}</string>
@@ -4450,6 +5470,35 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.brandonwalkin.BWToolkit</string>
+ <string>com.brandonwalkin.BWToolkit</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -4468,7 +5517,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">742</int>
+ <int key="maxID">884</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -4563,11 +5612,14 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>addHost:</string>
+ <string>addSchemaPriv:</string>
<string>addUser:</string>
<string>checkAllPrivileges:</string>
<string>doApply:</string>
<string>doCancel:</string>
+ <string>refresh:</string>
<string>removeHost:</string>
+ <string>removeSchemaPriv:</string>
<string>removeUser:</string>
<string>uncheckAllPrivileges:</string>
</object>
@@ -4581,21 +5633,40 @@
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>addSchemaPrivButton</string>
+ <string>availableController</string>
+ <string>availableTableView</string>
+ <string>grantedController</string>
+ <string>grantedTableView</string>
<string>outlineView</string>
<string>privsSupportedByServer</string>
+ <string>removeSchemaPrivButton</string>
+ <string>schemaController</string>
+ <string>schemasTableView</string>
<string>tabView</string>
<string>treeController</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSButton</string>
+ <string>NSArrayController</string>
+ <string>NSTableView</string>
+ <string>NSArrayController</string>
+ <string>NSTableView</string>
<string>NSOutlineView</string>
<string>NSMutableDictionary</string>
+ <string>NSButton</string>
+ <string>NSArrayController</string>
+ <string>NSTableView</string>
<string>NSTabView</string>
<string>NSTreeController</string>
</object>
@@ -4609,6 +5680,46 @@
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
+ <string key="className">BWAnchoredButton</string>
+ <string key="superclassName">NSButton</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">BWToolkitFramework.framework/Headers/BWAnchoredButton.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">BWAnchoredButtonBar</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">BWToolkitFramework.framework/Headers/BWAnchoredButtonBar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">BWAnchoredButtonCell</string>
+ <string key="superclassName">NSButtonCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">BWToolkitFramework.framework/Headers/BWAnchoredButtonCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">BWAnchoredPopUpButton</string>
+ <string key="superclassName">NSPopUpButton</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">BWToolkitFramework.framework/Headers/BWAnchoredPopUpButton.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">BWAnchoredPopUpButtonCell</string>
+ <string key="superclassName">NSPopUpButtonCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">BWToolkitFramework.framework/Headers/BWAnchoredPopUpButtonCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSActionCell</string>
<string key="superclassName">NSCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -4660,6 +5771,21 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">BWToolkitFramework.framework/Headers/NSApplication+BWAdditions.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSArrayController</string>
+ <string key="superclassName">NSObjectController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSArrayController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSBox</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -5297,6 +6423,13 @@
<reference key="sourceIdentifier" ref="700221146"/>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">BWToolkitFramework.framework/Headers/NSView+BWAdditions.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
@@ -5319,6 +6452,13 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">BWToolkitFramework.framework/Headers/NSWindow+BWAdditions.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSWindowController</string>
<string key="superclassName">NSResponder</string>
<object class="NSMutableDictionary" key="actions">
diff --git a/Source/SPUserManager.h b/Source/SPUserManager.h
index 0e619563..76a790e5 100644
--- a/Source/SPUserManager.h
+++ b/Source/SPUserManager.h
@@ -41,6 +41,21 @@
IBOutlet NSTabView *tabView;
IBOutlet NSTreeController *treeController;
IBOutlet NSMutableDictionary *privsSupportedByServer;
+
+ IBOutlet NSArrayController *schemaController;
+ IBOutlet NSArrayController *grantedController;
+ IBOutlet NSArrayController *availableController;
+
+ IBOutlet NSTableView *schemasTableView;
+ IBOutlet NSTableView *grantedTableView;
+ IBOutlet NSTableView *availableTableView;
+ IBOutlet NSButton *addSchemaPrivButton;
+ IBOutlet NSButton *removeSchemaPrivButton;
+
+
+ NSMutableArray *schemas;
+ NSMutableArray *grantedSchemaPrivs;
+ NSMutableArray *availablePrivs;
}
@property (nonatomic, retain) MCPConnection *mySqlConnection;
@@ -49,6 +64,10 @@
@property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext;
@property (nonatomic, retain) NSMutableDictionary *privsSupportedByServer;
+@property (nonatomic, retain) NSMutableArray *schemas;
+@property (nonatomic, retain) NSMutableArray *grantedSchemaPrivs;
+@property (nonatomic, retain) NSMutableArray *availablePrivs;
+
// Add/Remove users
- (IBAction)addUser:(id)sender;
- (IBAction)removeUser:(id)sender;
@@ -62,12 +81,21 @@
- (IBAction)checkAllPrivileges:(id)sender;
- (IBAction)uncheckAllPrivileges:(id)sender;
+// Schema Privieges
+- (IBAction)addSchemaPriv:(id)sender;
+- (IBAction)removeSchemaPriv:(id)sender;
+
+// Refresh
+- (IBAction)refresh:(id)sender;
+
// Core Data notifications
- (void)contextDidSave:(NSNotification *)notification;
- (BOOL)insertUsers:(NSArray *)insertedUsers;
- (BOOL)deleteUsers:(NSArray *)deletedUsers;
- (BOOL)updateUsers:(NSArray *)updatedUsers;
- (BOOL)grantPrivilegesToUser:(NSManagedObject *)user;
+- (BOOL)grantDbPrivilegesWithPrivilege:(NSManagedObject *)user;
+
- (NSArray *)treeSortDescriptors;
@end
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m
index c9be9a87..c2137f30 100644
--- a/Source/SPUserManager.m
+++ b/Source/SPUserManager.m
@@ -42,7 +42,15 @@
- (NSManagedObject *)_createNewSPUser;
- (BOOL)checkAndDisplayMySqlError;
- (void)_clearData;
-- (void)initializeChild:(NSManagedObject *)child withItem:(NSDictionary *)item;
+- (void)_initializeChild:(NSManagedObject *)child withItem:(NSDictionary *)item;
+- (void)_initializeSchemaPrivsForChild:(NSManagedObject *)child;
+- (void)_initializeSchemaPrivs;
+- (NSArray *)_fetchPrivsWithUser:(NSString *)username schema:(NSString *)selectedSchema host:(NSString *)host;
+- (void)_setSchemaPrivValues:(NSArray *)objects enabled:(BOOL)enabled;
+- (void) _initializeAvailablePrivs;
+
+
+
@end
@@ -53,6 +61,9 @@
@synthesize managedObjectContext;
@synthesize managedObjectModel;
@synthesize persistentStoreCoordinator;
+@synthesize schemas;
+@synthesize grantedSchemaPrivs;
+@synthesize availablePrivs;
-(id)init
{
@@ -71,6 +82,10 @@
@"Replication_client_priv", @"Repl_client_priv",
nil];
}
+ schemas = [[NSMutableArray alloc] init];
+ availablePrivs = [[NSMutableArray alloc] init];
+ grantedSchemaPrivs = [[NSMutableArray alloc] init];
+
return self;
}
@@ -89,6 +104,9 @@
[privColumnToGrantMap release];
[mySqlConnection release];
[privsSupportedByServer release];
+ [schemas release];
+ [availablePrivs release];
+ [grantedSchemaPrivs release];
[super dealloc];
}
@@ -108,6 +126,7 @@
[tableColumn setDataCell:imageAndTextCell];
[self _initializeUsers];
+ [self _initializeSchemaPrivs];
[super windowDidLoad];
}
@@ -192,12 +211,13 @@
// Add Children
NSManagedObject *parent = [parentResults objectAtIndex:0];
NSManagedObject *child = [self _createNewSPUser];
- [child setParent:parent];
- [parent addChildrenObject:child];
// Setup the NSManagedObject with values from the dictionary
- [self initializeChild:child withItem:item];
+ [self _initializeChild:child withItem:item];
+ NSMutableSet *children = [parent mutableSetValueForKey:@"children"];
+ [children addObject:child];
+ [self _initializeSchemaPrivsForChild:child];
} else {
// Add Parent
NSManagedObject *parent = [self _createNewSPUser];
@@ -206,10 +226,12 @@
// We only care about setting the user and password keys on the parent
[parent setValue:username forKey:@"user"];
[parent setValue:[item objectForKey:@"Password"] forKey:@"password"];
- [parent addChildrenObject:child];
- [child setParent:parent];
+
+ [self _initializeChild:child withItem:item];
- [self initializeChild:child withItem:item];
+ NSMutableSet *children = [parent mutableSetValueForKey:@"children"];
+ [children addObject:child];
+ [self _initializeSchemaPrivsForChild:child];
}
// Save the initialized objects so that any new changes will be tracked.
NSError *error = nil;
@@ -225,10 +247,47 @@
[treeController rearrangeObjects];
}
+- (void) _initializeAvailablePrivs {
+ // Initialize available privileges
+ NSManagedObjectContext *moc = self.managedObjectContext;
+ NSEntityDescription *privEntityDescription = [NSEntityDescription entityForName:@"Privileges"
+ inManagedObjectContext:moc];
+ NSArray *props = [privEntityDescription attributeKeys];
+ [availablePrivs removeAllObjects];
+
+ for (NSString *prop in props)
+ {
+ if ([prop hasSuffix:@"_priv"])
+ {
+ NSString *displayName = [[prop stringByReplacingOccurrencesOfString:@"_priv"
+ withString:@""] replaceUnderscoreWithSpace];
+ [availablePrivs addObject:[NSDictionary dictionaryWithObjectsAndKeys:displayName, @"displayName", prop, @"name", nil]];
+ }
+
+ }
+ [availableController rearrangeObjects];
+
+}
+- (void)_initializeSchemaPrivs
+{
+ // Initialize Databases
+ MCPResult *results = [self.mySqlConnection listDBs];
+ if ([results numOfRows]) {
+ [results dataSeek:0];
+ }
+ for (int i = 0; i < [results numOfRows]; i++) {
+ [schemas addObject:[results fetchRowAsDictionary]];
+ }
+ [schemaController rearrangeObjects];
+
+ [self _initializeAvailablePrivs];
+
+
+}
/**
* Set NSManagedObject with values from the passed in dictionary.
*/
-- (void)initializeChild:(NSManagedObject *)child withItem:(NSDictionary *)item
+- (void)_initializeChild:(NSManagedObject *)child withItem:(NSDictionary *)item
{
for (NSString *key in item)
{
@@ -265,6 +324,45 @@
}
}
+- (void)_initializeSchemaPrivsForChild:(NSManagedObject *)child
+{
+ // Assumes that the child has already been initialized with values from the
+ // global user table.
+ // Select rows from the db table that contains schema privs for each user/host
+ NSString *queryString = [NSString stringWithFormat:@"SELECT * from `mysql`.`db` d WHERE d.user='%@' and d.host='%@'",
+ [[child parent] valueForKey:@"user"], [child valueForKey:@"host"]];
+ MCPResult *queryResults = [self.mySqlConnection queryString:queryString];
+ if ([queryResults numOfRows] > 0)
+ {
+ // Go to the beginning
+ [queryResults dataSeek:0];
+ }
+
+ for (int i = 0; i < [queryResults numOfRows]; i++) {
+ NSDictionary *rowDict = [queryResults fetchRowAsDictionary];
+ NSManagedObject *dbPriv = [NSEntityDescription insertNewObjectForEntityForName:@"Privileges"
+ inManagedObjectContext:[self managedObjectContext]];
+ for (NSString *key in rowDict)
+ {
+ if ([key hasSuffix:@"_priv"])
+ {
+ BOOL boolValue = [[rowDict objectForKey:key] boolValue];
+ // Special case keys
+ if ([privColumnToGrantMap objectForKey:key])
+ {
+ key = [privColumnToGrantMap objectForKey:key];
+ }
+ [dbPriv setValue:[NSNumber numberWithBool:boolValue] forKey:key];
+ } else if (![key isEqualToString:@"Host"] && ![key isEqualToString:@"User"]) {
+ [dbPriv setValue:[rowDict objectForKey:key] forKey:key];
+ }
+ }
+ NSMutableSet *privs = [child mutableSetValueForKey:@"schema_privileges"];
+ [privs addObject:dbPriv];
+ }
+
+}
+
/**
* Creates, retains, and returns the managed object model for the application
* by merging all of the models found in the application bundle.
@@ -364,6 +462,8 @@
- (void)outlineViewSelectionDidChange:(NSNotification *)notification
{
+ if ([[treeController selectedObjects] count] == 0) return;
+
id selectedObject = [[treeController selectedObjects] objectAtIndex:0];
if ([selectedObject parent] == nil && !([[[tabView selectedTabViewItem] identifier] isEqualToString:@"General"])) {
@@ -374,6 +474,10 @@
[tabView selectTabViewItemWithIdentifier:@"Global Privileges"];
}
}
+
+ [schemasTableView deselectAll:nil];
+ [grantedTableView deselectAll:nil];
+ [availableTableView deselectAll:nil];
}
- (NSArray *)treeSortDescriptors
@@ -507,6 +611,85 @@
[treeController remove:sender];
}
+- (IBAction)addSchemaPriv:(id)sender
+{
+ NSArray *selectedObjects = [availableController selectedObjects];
+ [grantedController addObjects:selectedObjects];
+ [grantedTableView reloadData];
+ [availableController removeObjects:selectedObjects];
+ [availableTableView reloadData];
+ [self _setSchemaPrivValues:selectedObjects enabled:YES];
+}
+
+- (IBAction)removeSchemaPriv:(id)sender
+{
+ NSArray *selectedObjects = [grantedController selectedObjects];
+ [availableController addObjects:selectedObjects];
+ [availableTableView reloadData];
+ [grantedController removeObjects:selectedObjects];
+ [grantedTableView reloadData];
+ [self _setSchemaPrivValues:selectedObjects enabled:NO];
+
+}
+
+- (IBAction)refresh:(id)sender
+{
+ if ([self.managedObjectContext hasChanges])
+ {
+ NSAlert *alert = [[[NSAlert alloc] init] autorelease];
+ [alert addButtonWithTitle:NSLocalizedString(@"Continue", @"Continue")];
+ [alert addButtonWithTitle:NSLocalizedString(@"Cancel",@"Cancel")];
+ [alert setMessageText:@"Window has changes. All changes will be lost!"];
+ [alert setAlertStyle:NSWarningAlertStyle];
+ if ([alert runModal] == NSAlertAlternateReturn) // cancel
+ {
+ return;
+ }
+ }
+ [self.managedObjectContext reset];
+ [self _initializeUsers];
+ [treeController fetch:nil];
+
+}
+
+- (void)_setSchemaPrivValues:(NSArray *)objects enabled:(BOOL)enabled
+{
+ // The passed in objects should be an array of NSDictionaries with a key
+ // of "name".
+ NSManagedObject *selectedHost = [[treeController selectedObjects] objectAtIndex:0];
+ NSString *selectedDb = [[[schemaController selectedObjects] objectAtIndex:0] valueForKey:@"Database"];
+ NSArray *selectedPrivs = [self _fetchPrivsWithUser:[selectedHost valueForKeyPath:@"parent.user"]
+ schema:selectedDb
+ host:[selectedHost valueForKey:@"host"]];
+ NSManagedObject *priv = nil;
+ BOOL isNew = FALSE;
+
+ if ([selectedPrivs count] > 0)
+ {
+ priv = [selectedPrivs objectAtIndex:0];
+ }
+ else
+ {
+ priv = [NSEntityDescription insertNewObjectForEntityForName:@"Privileges"
+ inManagedObjectContext:[self managedObjectContext]];
+ [priv setValue:selectedDb forKey:@"db"];
+ isNew = TRUE;
+ }
+
+ // Now setup all the items that are selected to true
+ for (NSDictionary *obj in objects)
+ {
+ [priv setValue:[NSNumber numberWithBool:enabled] forKey:[obj valueForKey:@"name"]];
+ }
+
+ if (isNew)
+ {
+ // Set up relationship
+ NSMutableSet *privs = [selectedHost mutableSetValueForKey:@"schema_privileges"];
+ [privs addObject:priv];
+ }
+
+}
- (void)_clearData
{
[managedObjectContext reset];
@@ -608,14 +791,24 @@
if (!isInitializing) [outlineView reloadData];
}
+- (void)userManagerSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void*)context
+{
+ //[self refresh:nil];
+}
+
- (BOOL)updateUsers:(NSArray *)updatedUsers
{
for (NSManagedObject *user in updatedUsers) {
- if (![user host])
+ if ([[[user entity] name] isEqualToString:@"Privileges"])
+ {
+ [self grantDbPrivilegesWithPrivilege:user];
+ }
+ else if (![user host])
{
// Just the user password was changed.
// Change password to be the same on all hosts.
NSArray *hosts = [user valueForKey:@"children"];
+
for(NSManagedObject *child in hosts)
{
NSString *changePasswordStatement = [NSString stringWithFormat:
@@ -661,6 +854,8 @@
{
for (NSManagedObject *user in insertedUsers)
{
+ if ([[[user entity] name] isEqualToString:@"Privileges"]) continue;
+
NSString *createStatement;
if ([user parent] && [[user parent] valueForKey:@"user"] && [[user parent] valueForKey:@"password"]) {
@@ -683,6 +878,59 @@
}
/**
+ * Grant or revoke db privileges to the given user
+ *
+ */
+- (BOOL)grantDbPrivilegesWithPrivilege:(NSManagedObject *)schemaPriv
+{
+ NSMutableArray *grantPrivileges = [NSMutableArray array];
+ NSMutableArray *revokePrivileges = [NSMutableArray array];
+
+ NSString *dbName = [schemaPriv valueForKey:@"db"];
+ for (NSString *key in self.privsSupportedByServer)
+ {
+ if (![key hasSuffix:@"_priv"]) continue;
+ NSString *privilege = [key stringByReplacingOccurrencesOfString:@"_priv" withString:@""];
+ @try {
+ if ([[schemaPriv valueForKey:key] boolValue] == TRUE)
+ {
+ [grantPrivileges addObject:[privilege replaceUnderscoreWithSpace]];
+ }
+ else {
+ [revokePrivileges addObject:[privilege replaceUnderscoreWithSpace]];
+ }
+ }
+ @catch (NSException * e) {
+ }
+ }
+ // Grant privileges
+ if ([grantPrivileges count] > 0)
+ {
+ NSString *grantStatement = [NSString stringWithFormat:@"GRANT %@ ON %@.* TO %@@%@;",
+ [grantPrivileges componentsJoinedByCommas],
+ dbName,
+ [[schemaPriv valueForKeyPath:@"user.parent.user"] tickQuotedString],
+ [[schemaPriv valueForKeyPath:@"user.host"] tickQuotedString]];
+ DLog(@"%@", grantStatement);
+ [self.mySqlConnection queryString:grantStatement];
+ [self checkAndDisplayMySqlError];
+ }
+
+ // Revoke privileges
+ if ([revokePrivileges count] > 0)
+ {
+ NSString *revokeStatement = [NSString stringWithFormat:@"REVOKE %@ ON %@.* FROM %@@%@;",
+ [revokePrivileges componentsJoinedByCommas],
+ dbName,
+ [[schemaPriv valueForKeyPath:@"user.parent.user"] tickQuotedString],
+ [[schemaPriv valueForKeyPath:@"user.host"] tickQuotedString]];
+ DLog(@"%@", revokeStatement);
+ [self.mySqlConnection queryString:revokeStatement];
+ [self checkAndDisplayMySqlError];
+ }
+ return TRUE;
+}
+/**
* Grant or revoke privileges to the given user
*/
- (BOOL)grantPrivilegesToUser:(NSManagedObject *)user
@@ -734,6 +982,12 @@
[self checkAndDisplayMySqlError];
}
}
+
+ for(NSManagedObject *priv in [user valueForKey:@"schema_privileges"])
+ {
+ [self grantDbPrivilegesWithPrivilege:priv];
+ }
+
return TRUE;
}
@@ -760,6 +1014,26 @@
return array;
}
+- (NSArray *)_fetchPrivsWithUser:(NSString *)username schema:(NSString *)selectedSchema host:(NSString *)host
+{
+ NSManagedObjectContext *moc = [self managedObjectContext];
+ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(user.parent.user like[cd] %@) AND (user.host like[cd] %@) AND (db like[cd] %@)", username, host, selectedSchema];
+ NSEntityDescription *privEntity = [NSEntityDescription entityForName:@"Privileges"
+ inManagedObjectContext:moc];
+ NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
+ [request setEntity:privEntity];
+ [request setPredicate:predicate];
+
+ NSError *error = nil;
+ NSArray *array = [moc executeFetchRequest:request error:&error];
+ if (error != nil)
+ {
+ [[NSApplication sharedApplication] presentError:error];
+ }
+ return array;
+
+}
+
// Creates a new NSManagedObject and inserts it into the managedObjectContext.
- (NSManagedObject *)_createNewSPUser
{
@@ -825,4 +1099,67 @@
return (proposedMin + 120);
}
+#pragma mark -
+#pragma mark TableView Delegate Methods
+- (void)tableViewSelectionDidChange:(NSNotification *)notification
+{
+ if ([notification object] == schemasTableView)
+ {
+ [grantedSchemaPrivs removeAllObjects];
+ [grantedTableView reloadData];
+ [self _initializeAvailablePrivs];
+ if ([[treeController selectedObjects] count] > 0 && [[schemaController selectedObjects] count] > 0) {
+ NSManagedObject *user = [[treeController selectedObjects] objectAtIndex:0];
+ // Check to see if the user host node was selected
+ if ([user valueForKey:@"host"]) {
+ NSString *selectedSchema = [[[schemaController selectedObjects] objectAtIndex:0] valueForKey:@"Database"];
+ NSArray *results = [self _fetchPrivsWithUser:[[user parent] valueForKey:@"user"] schema:selectedSchema host:[user valueForKey:@"host"]];
+ if ([results count] > 0) {
+ NSManagedObject *priv = [results objectAtIndex:0];
+ for (NSPropertyDescription *property in [priv entity])
+ {
+ if ([[property name] hasSuffix:@"_priv"] && [[priv valueForKey:[property name]] boolValue])
+ {
+ NSString *displayName = [[[property name] stringByReplacingOccurrencesOfString:@"_priv"
+ withString:@""] replaceUnderscoreWithSpace];
+ NSDictionary *newDict = [NSDictionary dictionaryWithObjectsAndKeys:displayName, @"displayName", [property name], @"name", nil];
+ [grantedController addObject:newDict];
+
+ // Remove items from available so they can't be added twice.
+ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"displayName like[cd] %@", displayName];
+ NSArray *results = [[availableController arrangedObjects] filteredArrayUsingPredicate:predicate];
+ for (NSDictionary *dict in results)
+ {
+ [availableController removeObject:dict];
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ else if ([notification object] == grantedTableView)
+ {
+ if ([[grantedController selectedObjects] count] > 0)
+ {
+ removeSchemaPrivButton.enabled = TRUE;
+
+ } else {
+ removeSchemaPrivButton.enabled = FALSE;
+ }
+
+
+ }
+ else if ([notification object] == availableTableView)
+ {
+ if ([[availableController selectedObjects] count] > 0)
+ {
+ addSchemaPrivButton.enabled = TRUE;
+ } else {
+ addSchemaPrivButton.enabled = FALSE;
+ }
+
+ }
+}
+
@end
diff --git a/Source/SPUserManager.xcdatamodel/elements b/Source/SPUserManager.xcdatamodel/elements
index 6ef34877..b651569a 100644
--- a/Source/SPUserManager.xcdatamodel/elements
+++ b/Source/SPUserManager.xcdatamodel/elements
Binary files differ
diff --git a/Source/SPUserManager.xcdatamodel/layout b/Source/SPUserManager.xcdatamodel/layout
index b1f295a4..f55e70d0 100644
--- a/Source/SPUserManager.xcdatamodel/layout
+++ b/Source/SPUserManager.xcdatamodel/layout
Binary files differ
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 2502f984..3a9e8add 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -2183,7 +2183,7 @@
[NSApp beginSheet:[userManagerInstance window]
modalForWindow:tableWindow
modalDelegate:userManagerInstance
- didEndSelector:nil
+ didEndSelector:@selector(userManagerSheetDidEnd:returnCode:contextInfo:)
contextInfo:nil];
}