Skip to content

Commit f102a85

Browse files
authored
Merge pull request #71 from back4app/control-classes-permissions
Control classes permissions
2 parents 9d12104 + 9d2d963 commit f102a85

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/components/PermissionsCollaboratorDialog/PermissionsCollaboratorDialog.react.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,21 @@ export default class PermissionsCollaboratorDialog extends React.Component {
8383
customFeaturesPermissions,
8484
defaultFeaturesPermissions,
8585
features,
86-
classesPermissions
86+
classesPermissions,
87+
isGDPR
8788
}) {
8889
super();
8990

9091
const isDefaultFeatures = lodash.isEqual(customFeaturesPermissions, defaultFeaturesPermissions)
91-
const selectedClassesTab = customFeaturesPermissions['classes'] === 'Custom' ? 'CustomClasses' : customFeaturesPermissions['classes']
92+
const selectedClassesTab = !customFeaturesPermissions['classes'] ? 'Write' : (customFeaturesPermissions['classes'] === 'Custom' ? 'CustomClasses' : customFeaturesPermissions['classes'])
9293

9394
this.state = {
9495
transitioning: false,
9596
showLevels: false,
9697
level: 'Simple', // 'Simple' | 'Advanced'
9798
customFeaturesPermissions,
9899
features,
100+
isGDPR,
99101
isDefaultFeatures,
100102
isFeaturesSelected: true,
101103
selectedFeaturesTab: (isDefaultFeatures ? 'Default' : 'CustomFeatures'),
@@ -189,7 +191,7 @@ export default class PermissionsCollaboratorDialog extends React.Component {
189191
<Tab onClick={() => this.setState({ isFeaturesSelected: true })}>
190192
Features
191193
</Tab>
192-
<Tab onClick={() => this.setState({ isFeaturesSelected: false })}>
194+
<Tab style={ this.state.isGDPR ? {} : {display: 'none'}} onClick={() => this.setState({ isFeaturesSelected: false })}>
193195
Classes
194196
</Tab>
195197
</TabList>

src/components/PermissionsCollaboratorDialog/PermissionsCollaboratorDialog.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,4 +441,3 @@ p.description {
441441
.centralizedText {
442442
text-align: center
443443
}
444-

src/dashboard/Settings/Collaborators.react.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ export default class Collaborators extends React.Component {
175175
description='Configure how this user can access the App features.'
176176
advanced={false}
177177
confirmText='Save'
178+
isGDPR={this.context.currentApp.custom && this.context.currentApp.custom.isGDPR}
178179
customFeaturesPermissions={
179180
(
180181
(this.state.toEdit && this.state.currentFeaturesPermissions) ?

0 commit comments

Comments
 (0)