Skip to content

Commit e763df5

Browse files
committed
Merge branch 'release/0.2'
2 parents 69dabab + 1818f26 commit e763df5

33 files changed

+1410
-175
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Egor Tolstoy
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

ParseRevealer.xcodeproj/project.pbxproj

Lines changed: 114 additions & 18 deletions
Large diffs are not rendered by default.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
6+
<false/>
7+
<key>IDESourceControlProjectIdentifier</key>
8+
<string>6C1010CC-24B1-4B4E-BA3F-358279EDB872</string>
9+
<key>IDESourceControlProjectName</key>
10+
<string>ParseRevealer</string>
11+
<key>IDESourceControlProjectOriginsDictionary</key>
12+
<dict>
13+
<key>C8B41CB9246CC161D25C4D69915754CAA6DE2124</key>
14+
<string>https://github.com/igrekde/ParseRevealer.git</string>
15+
</dict>
16+
<key>IDESourceControlProjectPath</key>
17+
<string>ParseRevealer.xcodeproj</string>
18+
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
19+
<dict>
20+
<key>C8B41CB9246CC161D25C4D69915754CAA6DE2124</key>
21+
<string>../..</string>
22+
</dict>
23+
<key>IDESourceControlProjectURL</key>
24+
<string>https://github.com/igrekde/ParseRevealer.git</string>
25+
<key>IDESourceControlProjectVersion</key>
26+
<integer>111</integer>
27+
<key>IDESourceControlProjectWCCIdentifier</key>
28+
<string>C8B41CB9246CC161D25C4D69915754CAA6DE2124</string>
29+
<key>IDESourceControlProjectWCConfigurations</key>
30+
<array>
31+
<dict>
32+
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
33+
<string>public.vcs.git</string>
34+
<key>IDESourceControlWCCIdentifierKey</key>
35+
<string>C8B41CB9246CC161D25C4D69915754CAA6DE2124</string>
36+
<key>IDESourceControlWCCName</key>
37+
<string>ParseRevealer</string>
38+
</dict>
39+
</array>
40+
</dict>
41+
</plist>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
6+
<true/>
7+
<key>SnapshotAutomaticallyBeforeSignificantChanges</key>
8+
<false/>
9+
</dict>
10+
</plist>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
type = "1"
4+
version = "2.0">
5+
<Breakpoints>
6+
<BreakpointProxy
7+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
8+
<BreakpointContent
9+
shouldBeEnabled = "Yes"
10+
ignoreCount = "0"
11+
continueAfterRunningActions = "No"
12+
filePath = "ParseRevealer/ExportViewController.m"
13+
timestampString = "449606132.699997"
14+
startingColumnNumber = "9223372036854775807"
15+
endingColumnNumber = "9223372036854775807"
16+
startingLineNumber = "50"
17+
endingLineNumber = "50"
18+
landmarkName = "-exportButtonClicked:"
19+
landmarkType = "5">
20+
</BreakpointContent>
21+
</BreakpointProxy>
22+
</Breakpoints>
23+
</Bucket>

ParseRevealer/ACLFormatter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
/**
1414
* Method generates a proper output string for multiple classes' ACLs
1515
*
16-
* @param customClassesACLs NSDictionary with format {CustomClassName : CustomClassACLDictionary}
16+
* @param customClasses NSArray of ParseClassModels
1717
*
1818
* @return Output string
1919
*/
20-
+ (NSString *)stringFromCustomClassesACLs:(NSDictionary *)customClassesACLs;
20+
+ (NSString *)stringFromCustomClassesACLs:(NSArray *)customClasses;
2121

2222
/**
2323
* Method generates a proper output string for single ACL

ParseRevealer/ACLFormatter.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#import "ACLFormatter.h"
1010
#import "Constants.h"
11+
#import "ParseClassModel.h"
1112

1213
static NSString *const ACLPermissionTrue = @"True";
1314
static NSString *const ACLPermissionFalse = @"False";
@@ -28,12 +29,12 @@ + (NSString *)stringFromACLDictionary:(NSDictionary *)dictionary {
2829
return outputString;
2930
}
3031

31-
+ (NSString *)stringFromCustomClassesACLs:(NSDictionary *)customClassesACLs {
32+
+ (NSString *)stringFromCustomClassesACLs:(NSArray *)customClasses {
3233
NSMutableString *outputString = [NSMutableString new];
3334

34-
for (NSString *key in [customClassesACLs allKeys]) {
35-
NSDictionary *aclDictionary = [customClassesACLs objectForKey:key];
36-
[outputString appendString:[NSString stringWithFormat:@"%@ ACL:\n%@\n", key, [self stringFromACLDictionary:aclDictionary]]];
35+
for (ParseClassModel *classModel in customClasses) {
36+
NSDictionary *aclDictionary = classModel.permissions;
37+
[outputString appendString:[NSString stringWithFormat:@"%@ ACL:\n%@\n", classModel.className, [self stringFromACLDictionary:aclDictionary]]];
3738
}
3839

3940
return outputString;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// ACLRevealingViewController.h
3+
// ParseRevealer
4+
//
5+
// Created by Egor Tolstoy on 23.03.15.
6+
// Copyright (c) 2015 Egor Tolstoy. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
11+
@interface ACLRevealingViewController : NSViewController
12+
13+
@end
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
//
2+
// ACLRevealingViewController.m
3+
// ParseRevealer
4+
//
5+
// Created by Egor Tolstoy on 23.03.15.
6+
// Copyright (c) 2015 Egor Tolstoy. All rights reserved.
7+
//
8+
9+
#import "ACLRevealingViewController.h"
10+
#import "ParseRevealService.h"
11+
#import "ACLFormatter.h"
12+
#import "ParseClassModel.h"
13+
#import "ClassStorageService.h"
14+
15+
@interface ACLRevealingViewController ()
16+
17+
@property (strong, nonatomic) ParseRevealService *parseRevealService;
18+
@property (strong, nonatomic) ClassStorageService *classStorageService;
19+
20+
@property (unsafe_unretained) IBOutlet NSTextView *aclTextView;
21+
@property (weak) IBOutlet NSButton *revealButton;
22+
@property (weak) IBOutlet NSProgressIndicator *revealActivityIndicator;
23+
24+
@end
25+
26+
@implementation ACLRevealingViewController
27+
28+
#pragma mark - View Life Cycle
29+
30+
- (void)viewDidLoad {
31+
[super viewDidLoad];
32+
33+
self.parseRevealService = [ParseRevealService new];
34+
self.classStorageService = [ClassStorageService sharedInstance];
35+
}
36+
37+
- (void)viewWillAppear {
38+
if (self.classStorageService.parseClasses.count > 0) {
39+
self.revealButton.enabled = YES;
40+
self.aclTextView.string = @"";
41+
} else {
42+
self.revealButton.enabled = NO;
43+
self.aclTextView.string = @"It seems that you haven't added any of the Parse Custom Classes on the Basic Setup tab. Add them, press 'Save' and then proceed to the current tab.";
44+
}
45+
}
46+
47+
#pragma mark - IBActions
48+
49+
- (IBAction)revealButtonClicked:(id)sender {
50+
self.aclTextView.string = @"";
51+
[self.revealActivityIndicator startAnimation:self];
52+
[self revealParseClasses:[self.classStorageService.parseClasses allObjects]];
53+
}
54+
55+
#pragma mark - Private Methods
56+
57+
- (void)revealParseClasses:(NSArray *)parseClasses {
58+
[self.parseRevealService getAclForCustomClasses:parseClasses completionBlock:^(NSArray *customClasses, NSError *error) {
59+
dispatch_async(dispatch_get_main_queue(), ^(void){
60+
[self.aclTextView setString:[ACLFormatter stringFromCustomClassesACLs:customClasses]];
61+
[self.revealActivityIndicator stopAnimation:self];
62+
});
63+
}];
64+
}
65+
66+
67+
@end

0 commit comments

Comments
 (0)