diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/index.js
index 597fcc63c2d..f94ccbce133 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/index.js
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/index.js
@@ -49,8 +49,8 @@ class Pages extends React.Component {
homePageId: null,
};
this.hasPermissionToManage = isAuthorized(
- this.props.config.user,
- '/device-mgt/enterprise/user/view',
+ this.props.context.user,
+ '/permission/admin/device-mgt/enterprise/user/modify',
);
}
@@ -63,7 +63,9 @@ class Pages extends React.Component {
};
componentDidMount() {
- this.setHomePage();
+ if (this.hasPermissionToView) {
+ this.setHomePage();
+ }
this.fetch();
}
@@ -273,7 +275,7 @@ class Pages extends React.Component {
return (
Pages
-
+ {this.hasPermissionToManage &&
}
- {this.props.hasPermissionToManage && (
-
+
+ {this.props.hasPermissionToManage && (
-
- )}
+ )}
+
@@ -348,9 +348,14 @@ class Cluster extends React.Component {
-
- {name}
-
+ {this.props.hasPermissionToManage && (
+
+ {name}
+
+ )}
+ {!this.props.hasPermissionToManage && (
+ {name}
+ )}
{!isTemporary && this.props.hasPermissionToManage && (
@@ -413,51 +418,55 @@ class Cluster extends React.Component {
);
})}
-
-
- {isTemporary && (
-
-
-
-
+ {this.props.hasPermissionToManage && (
+
+
+ {isTemporary && (
+
+
+
+
+
+
+
+ )}
+ {!isTemporary && (
+
- )}
- {!isTemporary && (
-
-
-
-
-
- )}
-
-
+
+ )}
+
+
+ )}
);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/scenes/Page/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/scenes/Page/index.js
index 170d31dbc41..066e17c6ad9 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/scenes/Page/index.js
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/scenes/Page/index.js
@@ -63,15 +63,22 @@ class Page extends React.Component {
links: [],
};
this.hasPermissionToManage = isAuthorized(
- this.props.config.user,
- '/device-mgt/enterprise/user/view',
+ this.props.context.user,
+ '/permission/admin/device-mgt/enterprise/user/modify',
+ );
+
+ this.hasPermissionToView = isAuthorized(
+ this.props.context.user,
+ '/permission/admin/device-mgt/enterprise/user/view',
);
}
componentDidMount() {
- this.fetchClusters();
- this.fetchApplications();
- this.fetchPages();
+ if (this.hasPermissionToView) {
+ this.fetchClusters();
+ this.fetchApplications();
+ this.fetchPages();
+ }
}
removeLoadedCluster = clusterId => {
@@ -344,12 +351,17 @@ class Page extends React.Component {
>
-
- {pageName}
-
+ {this.hasPermissionToManage && (
+
+ {pageName}
+
+ )}
+ {!this.hasPermissionToManage && (
+ {pageName}
+ )}
@@ -412,6 +424,7 @@ class Page extends React.Component {
name: 'New Cluster',
products: [],
}}
+ hasPermissionToManage={true}
orderInPage={clusters.length}
isTemporary={true}
pageId={this.pageId}