@@ -12,10 +12,8 @@ import PermissionsDialog from 'components/PermissionsDialog/PermissionsDialog.re
12
12
import React from 'react' ;
13
13
import styles from 'dashboard/Data/Browser/Browser.scss' ;
14
14
15
- const PARSE_SERVER_SUPPORTS_POINTER_PERMISSIONS = false ;
16
-
17
- function validateEntry ( pointers , text ) {
18
- if ( PARSE_SERVER_SUPPORTS_POINTER_PERMISSIONS ) { //Eventually we will branch on whether or not the server supports pointer permissions
15
+ function validateEntry ( pointers , text , parseServerSupportsPointerPermissions ) {
16
+ if ( parseServerSupportsPointerPermissions ) {
19
17
if ( pointers . indexOf ( text ) > - 1 ) {
20
18
return Parse . Promise . as ( { pointer : text } ) ;
21
19
}
@@ -49,16 +47,17 @@ export default class SecurityDialog extends React.Component {
49
47
50
48
render ( ) {
51
49
let dialog = null ;
50
+ let parseServerSupportsPointerPermissions = this . context . currentApp . serverInfo . features . schemas . editClassLevelPermissions ;
52
51
if ( this . props . perms && this . state . open ) {
53
52
dialog = (
54
53
< PermissionsDialog
55
54
title = 'Edit Class Level Permissions'
56
- enablePointerPermissions = { PARSE_SERVER_SUPPORTS_POINTER_PERMISSIONS /* not supported by Parse Server yet */ }
55
+ enablePointerPermissions = { parseServerSupportsPointerPermissions }
57
56
advanced = { true }
58
57
confirmText = 'Save CLP'
59
58
details = { < a href = 'https://parse.com/docs/ios/guide#security-class-level-permissions' > Learn more about CLPs and app security</ a > }
60
59
permissions = { this . props . perms }
61
- validateEntry = { validateEntry . bind ( null , this . props . userPointers ) }
60
+ validateEntry = { entry => validateEntry ( this . props . userPointers , entry , parseServerSupportsPointerPermissions ) }
62
61
onCancel = { ( ) => {
63
62
this . setState ( { open : false } ) ;
64
63
} }
0 commit comments