Initial RBAC plugin display. Included about and debug page not rendering fix
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Tue, 11 Apr 2017 14:54:26 +0000 (10:54 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Tue, 11 Apr 2017 14:54:26 +0000 (10:54 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/framework/utils/roleConstants.js
skyquake/framework/widgets/form_controls/formControls.scss
skyquake/framework/widgets/skyquake_rbac/skyquakeRBAC.jsx
skyquake/plugins/accounts/config.json
skyquake/plugins/composer/config.json
skyquake/plugins/launchpad/config.json
skyquake/plugins/project_management/src/dashboard/projectMgmt.scss
skyquake/plugins/project_management/src/dashboard/projectMgmtStore.js
skyquake/plugins/user_management/config.json
skyquake/plugins/user_management/src/dashboard/userMgmt.scss
skyquake/plugins/user_management/src/userProfile/userProfile.jsx

index 95e36fc..96c4bf3 100644 (file)
@@ -7,8 +7,12 @@ c.PLATFORM = {
 }
 
 c.PROJECT = {
-    MANO_OPER: "rw-project-mano:mano-oper",
-    MANO_ADMIN: "rw-project-mano:mano-admin",
+    CATALOG_OPER: "rw-project-mano:catalog-oper",
+    CATALOG_ADMIN: "rw-project-mano:catalog-admin",
+    LCM_OPER: "rw-project-mano:lcm-oper",
+    LCM_ADMIN: "rw-project-mano:lcm-admin",
+    ACCOUNT_OPER: "rw-project-mano:account-oper",
+    ACCOUNT_ADMIN: "rw-project-mano:account-admin",
     PROJECT_ADMIN: "rw-project:project-admin",
     PROJECT_OPER: "rw-project:project-oper",
 }
index afa8508..1e29db7 100644 (file)
@@ -15,7 +15,7 @@
  *   limitations under the License.
  *
  */
-@import 'style/_colors.scss';
+@import '../../style/_colors.scss';
 
 .sqTextInput {
     display: -ms-flexbox;
index e00e672..cbb6a56 100644 (file)
@@ -26,15 +26,16 @@ export default class SkyquakeRBAC extends React.Component {
         super(props);
     }
     render() {
-      const User = this.context.userProfile.data;
+      const User = this.context.userProfile;
+      const UserData = User.data;
       let HTML = null;
       // If user object has platform property then it has been populated by the back end.
-      if(User) {
-        const PlatformRole = User.platform.role;
+      if(UserData) {
+        const PlatformRole = UserData.platform.role;
         const isPlatformSuper = PlatformRole[PLATFORM.SUPER];
         const isPlatformAdmin = PlatformRole[PLATFORM.ADMIN];
         const isPlatformOper = PlatformRole[PLATFORM.OPER];
-        const hasRoleAccess =  checkForRoleAccess(User.project[this.props.project], PlatformRole, this.props.allow)//false//(this.props.roles.indexOf(userProfile.projectRole) > -1)
+        const hasRoleAccess =  checkForRoleAccess(UserData.project[User.projectId], PlatformRole, this.props.allow)//false//(this.props.roles.indexOf(userProfile.projectRole) > -1)
         if (isPlatformSuper) {
           HTML = this.props.children;
         } else {
index 7bea692..3582888 100644 (file)
@@ -4,6 +4,7 @@
     "dashboard": "./account/accountsDashboard.jsx",
     "order": 3,
     "priority":1,
+    "allow": ["rw-rbac-platform:super-admin", "rw-project-mano:account-oper", "rw-project-mano:account-admin"],
     "routes": [
     {
         "label": "Accounts Dashboard",
index 80a2a0c..34b1084 100644 (file)
@@ -5,6 +5,10 @@
     "name": "Catalog",
     "dashboard" : "./src/components/ComposerApp.js",
     "order": 2,
+    "allow": [
+        "rw-rbac-platform:super-admin",
+        "rw-project-mano:catalog-oper",
+        "rw-project-mano:catalog-admin"],
     "routes" : [{
         "label": "Catalog",
         "route": "/",
index 851239f..1f4d145 100644 (file)
@@ -4,6 +4,7 @@
     "dashboard": "./launchpad.jsx",
     "order": 1,
     "priority":1,
+    "allow": ["rw-rbac-platform:super-admin", "rw-project-mano:lcm-oper", "rw-project-mano:lcm-admin"],
     "routes": [
     {
         "label": "Dashboard",
index a21aaa9..eca6a59 100644 (file)
@@ -6,7 +6,7 @@
 @import "style/_colors.scss";
 
 .projectManagement {
-        max-width: 900px;
+        max-width: 1200px;
 
     .skyquakePanel-wrapper {
         overflow-x: hidden;
     }
     .userTable {
         .FormSection-body {
-            max-width: 652px;
+            max-width: 952px;
             overflow-x: auto;
         }
     }
index ec3a099..71c10a2 100644 (file)
@@ -3,6 +3,7 @@
  */
 import ProjectManagementActions from './projectMgmtActions.js';
 import ProjectManagementSource from './projectMgmtSource.js';
+import ROLES from 'utils/roleConstants.js';
 import _ from 'lodash';
 export default class ProjectManagementStore {
     constructor() {
@@ -15,8 +16,10 @@ export default class ProjectManagementStore {
         this.projectUsers = [];
         this.selectedUser = null;
         this.selectedRole = null;
-        this.roles = ['rw-project:project-admin', 'rw-project:project-oper', 'rw-project:project-create'
-        ];
+        this.roles = Object.keys(ROLES.PROJECT).map((p) => {
+            return ROLES.PROJECT[p];
+        })
+        // this.roles = ['rw-project:project-admin', 'rw-project:project-oper', 'rw-project:project-create'];
         this.users = [];
         this.activeIndex = null;
         this.isReadOnly = true;
index 0366214..38de12f 100644 (file)
@@ -11,7 +11,8 @@
         "label": "User Management Dashboard",
         "route": "user-management",
         "component": "./dashboard/dashboard.jsx",
-        "type": "internal"
+        "type": "internal",
+        "allow": ["rw-rbac-platform:super-admin", "rw-rbac-platform:platform-admin", "rw-rbac-platform:platform-oper"]
     },{
         "label": "Platform Role Management",
         "route": "platform",
index 4e935ea..a265f0d 100644 (file)
@@ -83,7 +83,7 @@
 
         }
     }
-    .rbacButtonGroup {
+    .rbacButtonGroup, .buttonSection {
         margin: 0 0.5rem 0.5rem;
         background: #ddd;
         padding-bottom: 0.5rem;
index d7cb600..a786858 100644 (file)
@@ -237,7 +237,9 @@ class UserProfileDashboard extends React.Component {
                             {passwordSectionHTML}
 
                         </Panel>
-                         {formButtonsHTML}
+                        <div  className="buttonSection">
+                            {formButtonsHTML}
+                        </div>
                     </PanelWrapper>
 
                 </PanelWrapper>