diff --git a/static_src/components/users.jsx b/static_src/components/users.jsx index 96748433..9f6c10d8 100644 --- a/static_src/components/users.jsx +++ b/static_src/components/users.jsx @@ -43,9 +43,11 @@ function stateSetter() { let users = []; let parentEntityUsers; let currentUserAccess = false; + let entityGuid; const inviteDisabled = UserStore.inviteDisabled(); const usersSelectorDisabled = UserStore.usersSelectorDisabled(); - let entityGuid; + const isOrgUserManager = UserStore.hasRole(currentUser.guid, currentOrgGuid, + ORG_MANAGER); if (currentType === SPACE_NAME) { users = UserStore.getAllInSpace(currentSpaceGuid); @@ -56,8 +58,10 @@ function stateSetter() { } else { users = UserStore.getAllInOrg(currentOrgGuid); entityGuid = currentOrgGuid; - currentUserAccess = UserStore.hasRole(currentUser.guid, currentOrgGuid, - ORG_MANAGER); + } + + if (isOrgUserManager === true) { + currentUserAccess = true; } return { diff --git a/static_src/test/functional/user_role.spec.js b/static_src/test/functional/user_role.spec.js index 33fbc65e..44257fb3 100644 --- a/static_src/test/functional/user_role.spec.js +++ b/static_src/test/functional/user_role.spec.js @@ -230,6 +230,29 @@ describe('User roles', function () { expect(userRoleElement.isUserSpaceDeveloper(guidManagerOrgXSpaceYY)).toBe(true); }); }); + + describe('As org manager X', function () { + beforeEach(function () { + // sets cookie to org Y manager + cookieValue = cookieManagerOrgX; + }); + + describe('should have permission to edit fields on space Y pages', function () { + it('should set url to org X space XX', function () { + browser.url(urlOrgXSpaceXX); + }); + + it('verifies that the current user is a user with only permissions to org X', function () { + cookieResult = userRoleElement.setAndGetUserRole(cookieValue); + expect(cookieResult).toBe(cookieManagerOrgX); + }); + + it('verify org X manager can modify space XX page', function () { + browser.waitForExist('.test-user-role-control'); + expect(userRoleElement.isFirstUserRoleEnabled()).toBe(true); + }); + }); + }); }); describe('Testing space user roles', function () {