-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- OCUserPermissions: new object serving as an abstract interface to d…
…etermine a user's permissions to perform specific actions on the server - OCUser: add new property .permissions to hold an OCUserPermissions instance - OCConnection+GraphAPI: add new method to retrieve the permissions list for a user - OCConnection+Users: on ocis servers, retrieve permissions list for the logged in user and assign it to the returned OCUser's .permissions property
- Loading branch information
1 parent
14d3c93
commit d45f7d3
Showing
8 changed files
with
156 additions
and
1 deletion.
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
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
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,36 @@ | ||
// | ||
// OCUserPermissions.h | ||
// ownCloudSDK | ||
// | ||
// Created by Felix Schwarz on 04.02.25. | ||
// Copyright © 2025 ownCloud GmbH. All rights reserved. | ||
// | ||
|
||
/* | ||
* Copyright (C) 2025, ownCloud GmbH. | ||
* | ||
* This code is covered by the GNU Public License Version 3. | ||
* | ||
* For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/ | ||
* You should have received a copy of this license along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.en.html>. | ||
* | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
typedef NSString* OCUserPermissionIdentifier; //!< String representing a permission ("right") the user has to perform specific actions on the server | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface OCUserPermissions : NSObject | ||
|
||
// MARK: - Initializer | ||
- (instancetype)initWith:(NSArray<OCUserPermissionIdentifier> *)permissionIDs; | ||
|
||
// MARK: - Permissions | ||
@property(readonly,strong) NSArray<OCUserPermissionIdentifier> *identifiers; | ||
@property(readonly) BOOL canCreateSpaces; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_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,36 @@ | ||
// | ||
// OCUserPermissions.m | ||
// ownCloudSDK | ||
// | ||
// Created by Felix Schwarz on 04.02.25. | ||
// Copyright © 2025 ownCloud GmbH. All rights reserved. | ||
// | ||
|
||
/* | ||
* Copyright (C) 2025, ownCloud GmbH. | ||
* | ||
* This code is covered by the GNU Public License Version 3. | ||
* | ||
* For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/ | ||
* You should have received a copy of this license along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.en.html>. | ||
* | ||
*/ | ||
|
||
#import "OCUserPermissions.h" | ||
|
||
@implementation OCUserPermissions | ||
|
||
- (instancetype)initWith:(NSArray<OCUserPermissionIdentifier> *)permissionIDs | ||
{ | ||
if ((self = [super init]) != nil) | ||
{ | ||
_identifiers = permissionIDs; | ||
|
||
// Extract permissions | ||
_canCreateSpaces = [_identifiers containsObject:@"Drives.Create.all"]; | ||
} | ||
|
||
return (self); | ||
} | ||
|
||
@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
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