4

Being new to perfect server side swift, I cannot find any packages that help with role based access authorization. In Spring there is for example,

.antMatchers("/homePage").access("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')")
.antMatchers("/adminPage").access("hasRole('ROLE_ADMIN')")

Is there something already existing in perfect to help with this? Is there a recommended way of handling access control in perfect?

4

2 回答 2

1

当你使用完美的服务器时,你可以看看:

于 2017-12-11T13:29:31.580 回答
0

Perfect 提供系统级别的身份验证。

首先,您可以去 github 并搜索 PerfectlySoft/Perfect-LocalAuthentication 进行用户身份验证,但是,它不包含您所要求的角色控制。

它可以通过其他方法来完成。例如,您可以使用 Perfect-LDAP 访问各种角色和组的 LDAP 服务器。

于 2017-12-07T01:13:49.053 回答