12.07.2015 Views

4.3.1.Action의 역할 - Anyframe

4.3.1.Action의 역할 - Anyframe

4.3.1.Action의 역할 - Anyframe

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Authentication and Authorizationpublic ActionForward process(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws Exception {AuthenticationService authenticationService =(AuthenticationService) getService("authenticationService");UserForm userForm = (UserForm) form;UserVO userVO = new UserVO();BeanUtils.copyProperties(userVO, userForm);Subject subject = authenticationService.authenticate(userVO);HttpSession session = request.getSession();session.setAttribute("subject", subject);}return (mapping.findForward("success"));13.2.AuthorizationAction 단위로 접근 권한 제어가 가능하다.13.2.1.접근 권한 제어 프로세스다음 그림에서 보여지는 사용자 정보를 기반으로 어떻게 특정 URL에 대한 접근 제어가 이루어지는지살펴보도록 하자.1. Struts 속성 정의 파일 내에 Action 매핑시 roles 속성값 부여2. <strong>Anyframe</strong> 에서 확장한 DefaultRequestProcessor의 processRoles 메소드에서 Session에 저장되어 있는 Subject 객체의 값과 roles 정보 비교 후 해당 Action 수행 여부 결정61

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!