Class AbstractAdminComponentSessionController

    • Method Detail

      • isUserAdmin

        public boolean isUserAdmin()
      • checkAdminAccessOnly

        public void checkAdminAccessOnly()
        Checks the user has full admin access.
      • isAccessGranted

        public boolean isAccessGranted()
        Used mainly by checkAccessGranted().

        Each implementation can precise or change this default implementation.

        Returns:
        true if access granted, false otherwise.
      • checkAccessGranted

        public void checkAccessGranted()
        This method is invoked at each administration service access.
        Throws:
        ForbiddenRuntimeException - in case the user has forbidden access.
      • isAccessGranted

        public boolean isAccessGranted​(String spaceId,
                                       String instanceId,
                                       boolean readOnly)
                                throws ForbiddenRuntimeException
        Indicates if the user can access administration about a space or a component instance.

        Whatever the parameters, user having admin access right on its account is always access granted.

        If both space id and instance id are given, they are both verified.

        If neither space if neither instance id are given, it is verified that current user is a space manager.

        Parameters:
        spaceId - the optional identifier of a space.
        instanceId - the optional identifier of a component instance.
        readOnly - true if the operation is read only, false otherwise.
        Returns:
        true if access granted, false otherwise.
        Throws:
        ForbiddenRuntimeException
      • checkAccessGranted

        public void checkAccessGranted​(String spaceId,
                                       String instanceId,
                                       boolean readOnly)
                                throws ForbiddenRuntimeException
        Checks the user can access administration about a space or a component instance.

        Whatever the parameters, user having admin access right on its account is always access granted.

        If both space id and instance id are given, they are both verified.

        If neither space if neither instance id are given, it is verified that current user is a space manager.

        Parameters:
        spaceId - the optional identifier of a space.
        instanceId - the optional identifier of a component instance.
        readOnly - true if the operation is read only, false otherwise.
        Throws:
        ForbiddenRuntimeException - in case the user has forbidden access.
      • throwForbiddenError

        protected void throwForbiddenError()