1
This question 컨트롤러 클로저에 추가 할 코드가 있습니다.하지만 grails 기본 스캐 폴딩 뷰를 사용하고 싶지만 편집/업데이트 만하고 싶습니다. 사용자가 관리자이거나 도메인 객체가 사용자 소유이면 버튼이 나타 납니까? Reading the documentation는, 나는 시도했다 :Grails는 스프링 보안 코어 만 GSP에서 업데이트 할 수 있습니다.
<sec:access expression="hasRole('ROLE_MANAGER') || (projectInstance.owner == springSecurityService.currentUser)">
<span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
</sec:access>
그러나 액세스 클래스는 논리합을 허용하지 않는 것 :
Error processing GroovyPageView: Error executing tag <g:form>: Error executing tag <sec:access>: Cannot handle (124) '|'
사람은 비슷한 일을?
표현식이 간단한 역할 검사보다 약간 복잡하기 때문에이 접근 방식에 동의합니다. – Gregg