test_class.declarator: PROJECT_ID = "project"
test_class.modifier: private final
test_class.original_string: private final String PROJECT_ID = "project";
test_class.type: String
test_class.var_name: PROJECT_ID
test_class.declarator: USER_ID = "user"
test_class.modifier: private final
test_class.original_string: private final String USER_ID = "user";
test_class.type: String
test_class.var_name: USER_ID
test_class.declarator: LOB_DEPENDENT_STATUS = "open"
test_class.modifier: private final
test_class.original_string: private final String LOB_DEPENDENT_STATUS = "open";
test_class.type: String
test_class.var_name: LOB_DEPENDENT_STATUS
test_class.declarator: LOB_INDEPENDENT_STATUS = "escalated"
test_class.modifier: private final
test_class.original_string: private final String LOB_INDEPENDENT_STATUS = "escalated";
test_class.type: String
test_class.var_name: LOB_INDEPENDENT_STATUS
test_class.declarator: userServiceMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserService userServiceMock;
test_class.type: UserService
test_class.var_name: userServiceMock
test_class.declarator: projectServiceMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ProjectService projectServiceMock;
test_class.type: ProjectService
test_class.var_name: projectServiceMock
test_class.declarator: applicationServiceMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ApplicationService applicationServiceMock;
test_class.type: ApplicationService
test_class.var_name: applicationServiceMock
test_class.declarator: userAccessServiceMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserAccessService userAccessServiceMock;
test_class.type: UserAccessService
test_class.var_name: userAccessServiceMock
test_class.declarator: bookmarkServiceMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private BookmarkService bookmarkServiceMock;
test_class.type: BookmarkService
test_class.var_name: bookmarkServiceMock
test_class.declarator: authenticationMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Authentication authenticationMock;
test_class.type: Authentication
test_class.var_name: authenticationMock
test_class.declarator: userMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private User userMock;
test_class.type: User
test_class.var_name: userMock
test_class.declarator: projectMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Project projectMock;
test_class.type: Project
test_class.var_name: projectMock
test_class.declarator: userDataMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserData userDataMock;
test_class.type: UserData
test_class.var_name: userDataMock
test_class.declarator: propertiesMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ProjectBoardConfigurationProperties propertiesMock;
test_class.type: ProjectBoardConfigurationProperties
test_class.var_name: propertiesMock
test_class.declarator: evaluator
test_class.modifier: private
test_class.original_string: private UserAccessExpressionEvaluator evaluator;
test_class.type: UserAccessExpressionEvaluator
test_class.var_name: evaluator
test_class.file: backend/project-board/src/test/java/de/adesso/projectboard/rest/security/UserAccessExpressionEvaluatorTest.java
test_class.identifier: UserAccessExpressionEvaluatorTest
test_case.body: @Test
      public void hasElevatedAccessToUserReturnsTrueWhenUserIsStaffMember() {
          // given
          String accessedUserId = "other";
          User accessedUserMock = mock(User.class);
  
          given(userServiceMock.getUserById(accessedUserId)).willReturn(accessedUserMock);
          given(userServiceMock.userExists(accessedUserId)).willReturn(true);
          given(userServiceMock.userHasStaffMember(userMock, accessedUserMock)).willReturn(true);
  
          // when
          boolean actualHasPermission = evaluator.hasElevatedAccessToUser(authenticationMock, userMock, accessedUserId);
  
          // then
          assertThat(actualHasPermission).isTrue();
      }
test_case.class_method_signature: UserAccessExpressionEvaluatorTest.hasElevatedAccessToUserReturnsTrueWhenUserIsStaffMember()
test_case.full_signature: @Test public void hasElevatedAccessToUserReturnsTrueWhenUserIsStaffMember()
test_case.identifier: hasElevatedAccessToUserReturnsTrueWhenUserIsStaffMember
test_case.invocations: mock willReturn given getUserById willReturn given userExists willReturn given userHasStaffMember hasElevatedAccessToUser isTrue assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void hasElevatedAccessToUserReturnsTrueWhenUserIsStaffMember()
focal_class.declarator: userService
focal_class.modifier: private final
focal_class.original_string: private final UserService userService;
focal_class.type: UserService
focal_class.var_name: userService
focal_class.declarator: userAccessService
focal_class.modifier: private final
focal_class.original_string: private final UserAccessService userAccessService;
focal_class.type: UserAccessService
focal_class.var_name: userAccessService
focal_class.declarator: projectService
focal_class.modifier: private final
focal_class.original_string: private final ProjectService projectService;
focal_class.type: ProjectService
focal_class.var_name: projectService
focal_class.declarator: applicationService
focal_class.modifier: private final
focal_class.original_string: private final ApplicationService applicationService;
focal_class.type: ApplicationService
focal_class.var_name: applicationService
focal_class.declarator: bookmarkService
focal_class.modifier: private final
focal_class.original_string: private final BookmarkService bookmarkService;
focal_class.type: BookmarkService
focal_class.var_name: bookmarkService
focal_class.declarator: lobDependentStatus
focal_class.modifier: private final
focal_class.original_string: private final Set<String> lobDependentStatus;
focal_class.type: Set<String>
focal_class.var_name: lobDependentStatus
focal_class.file: backend/project-board/src/main/java/de/adesso/projectboard/rest/security/UserAccessExpressionEvaluator.java
focal_class.identifier: UserAccessExpressionEvaluator
focal_class.interfaces: implements ExpressionEvaluator
focal_class.class_method_signature: UserAccessExpressionEvaluator.UserAccessExpressionEvaluator(UserService userService,
                                           UserAccessService userAccessService,
                                           ProjectService projectService,
                                           ApplicationService applicationService,
                                           BookmarkService bookmarkService,
                                           ProjectBoardConfigurationProperties properties)
focal_class.full_signature: @Autowired public  UserAccessExpressionEvaluator(UserService userService,
                                           UserAccessService userAccessService,
                                           ProjectService projectService,
                                           ApplicationService applicationService,
                                           BookmarkService bookmarkService,
                                           ProjectBoardConfigurationProperties properties)
focal_class.identifier: UserAccessExpressionEvaluator
focal_class.modifiers: @Autowired public
focal_class.parameters: (UserService userService,
                                           UserAccessService userAccessService,
                                           ProjectService projectService,
                                           ApplicationService applicationService,
                                           BookmarkService bookmarkService,
                                           ProjectBoardConfigurationProperties properties)
focal_class.signature:  UserAccessExpressionEvaluator(UserService userService,
                                           UserAccessService userAccessService,
                                           ProjectService projectService,
                                           ApplicationService applicationService,
                                           BookmarkService bookmarkService,
                                           ProjectBoardConfigurationProperties properties)
focal_class.class_method_signature: UserAccessExpressionEvaluator.hasAccessToProjects(Authentication authentication, User user)
focal_class.full_signature: @Override public boolean hasAccessToProjects(Authentication authentication, User user)
focal_class.identifier: hasAccessToProjects
focal_class.modifiers: @Override public
focal_class.parameters: (Authentication authentication, User user)
focal_class.return: boolean
focal_class.signature: boolean hasAccessToProjects(Authentication authentication, User user)
focal_class.class_method_signature: UserAccessExpressionEvaluator.hasAccessToProject(Authentication authentication, User user, String projectId)
focal_class.full_signature: @Override public boolean hasAccessToProject(Authentication authentication, User user, String projectId)
focal_class.identifier: hasAccessToProject
focal_class.modifiers: @Override public
focal_class.parameters: (Authentication authentication, User user, String projectId)
focal_class.return: boolean
focal_class.signature: boolean hasAccessToProject(Authentication authentication, User user, String projectId)
focal_class.class_method_signature: UserAccessExpressionEvaluator.hasPermissionToApplyToProject(Authentication authentication, User user, String projectId)
focal_class.full_signature: @Override public boolean hasPermissionToApplyToProject(Authentication authentication, User user, String projectId)
focal_class.identifier: hasPermissionToApplyToProject
focal_class.modifiers: @Override public
focal_class.parameters: (Authentication authentication, User user, String projectId)
focal_class.return: boolean
focal_class.signature: boolean hasPermissionToApplyToProject(Authentication authentication, User user, String projectId)
focal_class.class_method_signature: UserAccessExpressionEvaluator.hasPermissionToAccessUser(Authentication authentication, User user, String userId)
focal_class.full_signature: @Override public boolean hasPermissionToAccessUser(Authentication authentication, User user, String userId)
focal_class.identifier: hasPermissionToAccessUser
focal_class.modifiers: @Override public
focal_class.parameters: (Authentication authentication, User user, String userId)
focal_class.return: boolean
focal_class.signature: boolean hasPermissionToAccessUser(Authentication authentication, User user, String userId)
focal_class.class_method_signature: UserAccessExpressionEvaluator.hasElevatedAccessToUser(Authentication authentication, User user, String userId)
focal_class.full_signature: @Override public boolean hasElevatedAccessToUser(Authentication authentication, User user, String userId)
focal_class.identifier: hasElevatedAccessToUser
focal_class.modifiers: @Override public
focal_class.parameters: (Authentication authentication, User user, String userId)
focal_class.return: boolean
focal_class.signature: boolean hasElevatedAccessToUser(Authentication authentication, User user, String userId)
focal_class.class_method_signature: UserAccessExpressionEvaluator.projectDoesNotExistOrHasLobIndependentStatus(String projectId)
focal_class.full_signature:  boolean projectDoesNotExistOrHasLobIndependentStatus(String projectId)
focal_class.identifier: projectDoesNotExistOrHasLobIndependentStatus
focal_class.parameters: (String projectId)
focal_class.return: boolean
focal_class.signature: boolean projectDoesNotExistOrHasLobIndependentStatus(String projectId)
focal_method.body: @Override
      public boolean hasElevatedAccessToUser(Authentication authentication, User user, String userId) {
          if(userService.userExists(userId)) {
              return userService.userHasStaffMember(user, userService.getUserById(userId));
          }
  
          return true;
      }
focal_method.class_method_signature: UserAccessExpressionEvaluator.hasElevatedAccessToUser(Authentication authentication, User user, String userId)
focal_method.full_signature: @Override public boolean hasElevatedAccessToUser(Authentication authentication, User user, String userId)
focal_method.identifier: hasElevatedAccessToUser
focal_method.invocations: userExists userHasStaffMember getUserById
focal_method.modifiers: @Override public
focal_method.parameters: (Authentication authentication, User user, String userId)
focal_method.return: boolean
focal_method.signature: boolean hasElevatedAccessToUser(Authentication authentication, User user, String userId)