-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add administrative features (set/retrieve groups and ACLs, channel cr…
…eation).
- Loading branch information
1 parent
1518c08
commit bf23e9d
Showing
12 changed files
with
488 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ Thorvald Natvig <[email protected]> | |
Mikkel Krautz <[email protected]> | ||
Stefan Hacker <[email protected]> | ||
Benjamin Jemlich <[email protected]> | ||
TOK.TV Inc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// This is the official list of people who can contribute | ||
// (and typically have contributed) code to MumbleKit. | ||
|
||
Benjamin Jemlich <[email protected]> | ||
Emilio Pavia <[email protected]> | ||
Mikkel Krautz <[email protected]> | ||
Stefan Hacker <[email protected]> | ||
Thorvald Natvig <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2012 The MumbleKit Developers. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
#import "MKAccessControl.h" | ||
|
||
@implementation MKAccessControl | ||
|
||
@synthesize inheritACLs; | ||
@synthesize groups; | ||
@synthesize acls; | ||
|
||
- (NSString *) description { | ||
return [NSString stringWithFormat:@"{\n\tinheritACLs: %@\n\tgroups: %@\n\tacls: %@\n}", self.inheritACLs ? @"YES" : @"NO", self.groups, self.acls]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
// Copyright 2012 The MumbleKit Developers. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
#import "MKChannelACL.h" | ||
|
||
@implementation MKChannelACL | ||
|
||
@synthesize applyHere; | ||
@synthesize applySubs; | ||
@synthesize inherited; | ||
@synthesize userID; | ||
@synthesize group; | ||
@synthesize grant; | ||
@synthesize deny; | ||
|
||
- (BOOL) hasUserID { | ||
return (self.userID > -1); | ||
} | ||
|
||
- (NSString *) description { | ||
NSMutableString *grantDescription = [[NSMutableString alloc] init]; | ||
if (self.grant == MKPermissionAll) { | ||
[grantDescription appendString:@"All"]; | ||
} else if (self.grant == MKPermissionNone) { | ||
[grantDescription appendString:@"None"]; | ||
} else { | ||
if ((self.grant & MKPermissionWrite) == MKPermissionWrite) { | ||
[grantDescription appendString:@"Write | "]; | ||
} | ||
if ((self.grant & MKPermissionTraverse) == MKPermissionTraverse) { | ||
[grantDescription appendString:@"Traverse | "]; | ||
} | ||
if ((self.grant & MKPermissionEnter) == MKPermissionEnter) { | ||
[grantDescription appendString:@"Enter | "]; | ||
} | ||
if ((self.grant & MKPermissionSpeak) == MKPermissionSpeak) { | ||
[grantDescription appendString:@"Speak | "]; | ||
} | ||
if ((self.grant & MKPermissionMuteDeafen) == MKPermissionMuteDeafen) { | ||
[grantDescription appendString:@"MuteDeafen | "]; | ||
} | ||
if ((self.grant & MKPermissionMove) == MKPermissionMove) { | ||
[grantDescription appendString:@"Move | "]; | ||
} | ||
if ((self.grant & MKPermissionMakeChannel) == MKPermissionMakeChannel) { | ||
[grantDescription appendString:@"MakeChannel | "]; | ||
} | ||
if ((self.grant & MKPermissionLinkChannel) == MKPermissionLinkChannel) { | ||
[grantDescription appendString:@"LinkChannel | "]; | ||
} | ||
if ((self.grant & MKPermissionWhisper) == MKPermissionWhisper) { | ||
[grantDescription appendString:@"Whisper | "]; | ||
} | ||
if ((self.grant & MKPermissionTextMessage) == MKPermissionTextMessage) { | ||
[grantDescription appendString:@"TextMessage | "]; | ||
} | ||
if ((self.grant & MKPermissionMakeTempChannel) == MKPermissionMakeTempChannel) { | ||
[grantDescription appendString:@"MakeTempChannel | "]; | ||
} | ||
if ((self.grant & MKPermissionKick) == MKPermissionKick) { | ||
[grantDescription appendString:@"Kick | "]; | ||
} | ||
if ((self.grant & MKPermissionBan) == MKPermissionBan) { | ||
[grantDescription appendString:@"Ban | "]; | ||
} | ||
if ((self.grant & MKPermissionRegister) == MKPermissionRegister) { | ||
[grantDescription appendString:@"Register | "]; | ||
} | ||
if ((self.grant & MKPermissionSelfRegister) == MKPermissionSelfRegister) { | ||
[grantDescription appendString:@"SelfRegister | "]; | ||
} | ||
|
||
if (grantDescription.length > 0) { | ||
grantDescription = [NSMutableString stringWithString:[grantDescription substringToIndex:grantDescription.length-3]]; | ||
} | ||
} | ||
|
||
NSMutableString *denyDescription = [[NSMutableString alloc] init]; | ||
if (self.deny == MKPermissionAll) { | ||
[denyDescription appendString:@"All"]; | ||
} else if (self.deny == MKPermissionNone) { | ||
[denyDescription appendString:@"None"]; | ||
} else { | ||
if ((self.deny & MKPermissionWrite) == MKPermissionWrite) { | ||
[denyDescription appendString:@"Write | "]; | ||
} | ||
if ((self.deny & MKPermissionTraverse) == MKPermissionTraverse) { | ||
[denyDescription appendString:@"Traverse | "]; | ||
} | ||
if ((self.deny & MKPermissionEnter) == MKPermissionEnter) { | ||
[denyDescription appendString:@"Enter | "]; | ||
} | ||
if ((self.deny & MKPermissionSpeak) == MKPermissionSpeak) { | ||
[denyDescription appendString:@"Speak | "]; | ||
} | ||
if ((self.deny & MKPermissionMuteDeafen) == MKPermissionMuteDeafen) { | ||
[denyDescription appendString:@"MuteDeafen | "]; | ||
} | ||
if ((self.deny & MKPermissionMove) == MKPermissionMove) { | ||
[denyDescription appendString:@"Move | "]; | ||
} | ||
if ((self.deny & MKPermissionMakeChannel) == MKPermissionMakeChannel) { | ||
[denyDescription appendString:@"MakeChannel | "]; | ||
} | ||
if ((self.deny & MKPermissionLinkChannel) == MKPermissionLinkChannel) { | ||
[denyDescription appendString:@"LinkChannel | "]; | ||
} | ||
if ((self.deny & MKPermissionWhisper) == MKPermissionWhisper) { | ||
[denyDescription appendString:@"Whisper | "]; | ||
} | ||
if ((self.deny & MKPermissionTextMessage) == MKPermissionTextMessage) { | ||
[denyDescription appendString:@"TextMessage | "]; | ||
} | ||
if ((self.deny & MKPermissionMakeTempChannel) == MKPermissionMakeTempChannel) { | ||
[denyDescription appendString:@"MakeTempChannel | "]; | ||
} | ||
if ((self.deny & MKPermissionKick) == MKPermissionKick) { | ||
[denyDescription appendString:@"Kick | "]; | ||
} | ||
if ((self.deny & MKPermissionBan) == MKPermissionBan) { | ||
[denyDescription appendString:@"Ban | "]; | ||
} | ||
if ((self.deny & MKPermissionRegister) == MKPermissionRegister) { | ||
[denyDescription appendString:@"Register | "]; | ||
} | ||
if ((self.deny & MKPermissionSelfRegister) == MKPermissionSelfRegister) { | ||
[denyDescription appendString:@"SelfRegister | "]; | ||
} | ||
|
||
if (denyDescription.length > 0) { | ||
denyDescription = [NSMutableString stringWithString:[denyDescription substringToIndex:denyDescription.length-3]]; | ||
} | ||
} | ||
|
||
return [NSString stringWithFormat:@"{applyHere: %@; applySubs: %@; inherited: %@; %@: %@; grant: %@; deny: %@}", | ||
self.applyHere ? @"YES" : @"NO", | ||
self.applySubs ? @"YES" : @"NO", | ||
self.inherited ? @"YES" : @"NO", | ||
self.hasUserID ? @"userID" : @"group", | ||
self.hasUserID ? [NSNumber numberWithInt:self.userID] : self.group, | ||
grantDescription, | ||
denyDescription]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2012 The MumbleKit Developers. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
#import "MKChannelGroup.h" | ||
|
||
@implementation MKChannelGroup | ||
|
||
@synthesize name; | ||
@synthesize inherited; | ||
@synthesize inherit; | ||
@synthesize inheritable; | ||
@synthesize members; | ||
@synthesize excludedMembers; | ||
@synthesize inheritedMembers; | ||
|
||
- (NSString *) description { | ||
return [NSString stringWithFormat:@"{name: %@; inherited: %@; inherit: %@; inheritable: %@; members: %@; excludedMembers: %@; inheritedMembers: %@}", | ||
self.name, | ||
self.inherited ? @"YES" : @"NO", | ||
self.inherit ? @"YES" : @"NO", | ||
self.inheritable ? @"YES" : @"NO", | ||
self.members, | ||
self.excludedMembers, | ||
self.inheritedMembers]; | ||
} | ||
@end |
Oops, something went wrong.