Skip to content

Commit 9ed0bd4

Browse files
[fix/space-admin-permissions] Add support for space admin permissions (#1517)
* - ios-sdk: updated SDK with extended permission properties - DisableSpaceAction: - check correct permission for availability - add proper handling of Space Admin permissions - ManageSpaceAction: add proper handling of Space Admin permissions * - update SDK reference to target master
1 parent 8a778d7 commit 9ed0bd4

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

ownCloud/Client/Actions/Actions+Extensions/DisableSpaceAction.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ public class DisableSpaceAction : Action {
3232
override open class func applicablePosition(forContext: ActionContext) -> ActionPosition {
3333
if let core = forContext.core, core.connectionStatus == .online, let drive = forContext.drive, drive.specialType == .space {
3434
if let shareActions = core.connection.shareActions(for: drive) {
35-
if shareActions.contains(.updatePermissions) {
35+
if shareActions.contains(.deletePermissions) {
3636
return .last
3737
}
3838
}
39+
if let userPermissions = core.connection.loggedInUser?.permissions, userPermissions.canDisableSpaces {
40+
return .last
41+
}
3942
}
4043

4144
return .none

ownCloud/Client/Actions/Actions+Extensions/ManageSpaceAction.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ public class ManageSpaceAction : Action {
3636
return .first
3737
}
3838
}
39+
if let userPermissions = core.connection.loggedInUser?.permissions, userPermissions.canEditSpaces {
40+
return .first
41+
}
3942
}
4043
return .none
4144
}

0 commit comments

Comments
 (0)