Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2111 from RocketChat/v3.0.4
Browse files Browse the repository at this point in the history
[RELEASE] Merge release 3.0.4 into MASTER
  • Loading branch information
rafaelks committed Aug 6, 2018
2 parents 6ce3162 + 496c343 commit 962b677
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Rocket.Chat.ShareExtension/Info.plist
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>3.0.3</string>
<string>3.0.4</string>
<key>CFBundleVersion</key>
<string>203</string>
<string>206</string>
<key>ITSEncryptionExportComplianceCode</key>
<string></string>
<key>NSExtension</key>
Expand Down
Expand Up @@ -183,6 +183,12 @@ final class ConnectServerViewController: BaseViewController {
controller.serverVersion = infoRequestHandler.version
controller.serverURL = url
controller.serverPublicSettings = serverPublicSettings

if let credentials = deepLinkCredentials {
_ = controller.view
controller.authenticateWithDeepLinkCredentials(credentials)
deepLinkCredentials = nil
}
}

if let controller = segue.destination as? AuthTableViewController, segue.identifier == "Auth" {
Expand Down
6 changes: 6 additions & 0 deletions Rocket.Chat/Controllers/Auth/LoginTableViewController.swift
Expand Up @@ -164,6 +164,12 @@ class LoginTableViewController: BaseTableViewController {

// MARK: Actions

func authenticateWithDeepLinkCredentials(_ credentials: DeepLinkCredentials) {
view.layoutIfNeeded()
startLoading()
AuthManager.auth(token: credentials.token, completion: self.handleAuthenticationResponse)
}

@IBAction func buttonOnePasswordDidPressed(_ sender: Any) {
let siteURL = serverPublicSettings?.siteURL ?? ""
OnePasswordExtension.shared().findLogin(forURLString: siteURL, for: self, sender: sender) { [weak self] (login, _) in
Expand Down
4 changes: 2 additions & 2 deletions Rocket.Chat/Info.plist
Expand Up @@ -206,7 +206,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.0.3</string>
<string>3.0.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -222,7 +222,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>203</string>
<string>206</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
7 changes: 2 additions & 5 deletions Rocket.Chat/Models/User/UserPermissions.swift
Expand Up @@ -5,7 +5,6 @@
// Created by Matheus Cardoso on 5/16/18.
// Copyright © 2018 Rocket.Chat. All rights reserved.
//

import RealmSwift

extension User {
Expand All @@ -20,11 +19,9 @@ extension User {
func hasPermission(_ permission: PermissionType, subscription: Subscription? = nil, realm: Realm? = Realm.current) -> Bool {
guard let permissionRoles = PermissionManager.roles(for: permission, realm: realm) else { return false }

let roles: [String]
var roles: [String] = Array(self.roles)
if let subscription = subscription {
roles = rolesInSubscription(subscription)
} else {
roles = Array(self.roles)
roles += rolesInSubscription(subscription)
}

for userRole in roles {
Expand Down

0 comments on commit 962b677

Please sign in to comment.