0
如您所知,我们可以通过spring security为特定网址设置权限。例如
.antmatchers("/assets/**").permitall()
我的问题是: 我使用$ stateProvider在项目AngularJS。
所以URL路径Localhost/#/home
,localhost/#/userList
。
例如,使用安全性,我想登录到/#/userList
与"ADMIN"
权限。
.antmatchers("/#/userList").hasauthority("ADMIN")
我想这是不可能的。我们如何解决这个问题?
您必须在角度上对用户进行身份验证和授权,因为这些带#的URL是角URL而不是Java Spring。你的java spring应用程序可以识别#之前的部分,不管#是否与角度有关。 –
你认为locationprovider html5mode是什么? – forguta
看看这里(我用它在我的应用程序):http://www.stefanoscerra.it/permission-based-auth-system-in-angularjs/ –