2016-02-26 61 views
0

我正在嘗試一些非常簡單的Grails 3,並一直有困難。我有一個名爲WorkOrder的控制器。我想繼續爲它生成腳手架,所以我沒有興趣在此處添加用於訪問控制(有效)的註釋。在我application.groovy我有:根據我的文檔閱讀本應該要求的角色ROLE_SECRET訪問下/工單/什麼Grails 3 InterceptUrlMap,它應該工作嗎?

grails.plugin.springsecurity.interceptUrlMap = [ 
    [pattern: '/workOrder/**',    access: ['ROLE_SECRET']] 
] 

。它似乎沒有工作,不僅如此,但是當我試圖與它有這個角色的用戶訪問/工單/指數,我得到一個403錯誤

Access is denied (user is not anonymous); delegating to AccessDeniedHandler 

缺少什麼我在這裏?

在此先感謝您的幫助。

回答

1

添加securityConfigType指出InterceptUrlMap:

grails.plugin.springsecurity.securityConfigType = grails.plugin.springsecurity.SecurityConfigType.InterceptUrlMap