mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-01 10:21:26 +08:00
优化scope解析
This commit is contained in:
@@ -63,7 +63,7 @@ public class DefaultAuthorizationCodeGranter implements AuthorizationCodeGranter
|
||||
if (StringUtils.isEmpty(scopeStr)) {
|
||||
return ((permission, s) -> false);
|
||||
}
|
||||
String[] scopes = scopeStr.split("[,]");
|
||||
String[] scopes = scopeStr.split("[ ,\n]");
|
||||
Map<String, Set<String>> actions = new HashMap<>();
|
||||
for (String scope : scopes) {
|
||||
String[] permissions = scope.split("[:]");
|
||||
|
||||
@@ -19,7 +19,7 @@ public class DefaultAuthorizationCodeGranterTest {
|
||||
|
||||
@Test
|
||||
public void testPermission() {
|
||||
BiPredicate<Permission, String> predicate = DefaultAuthorizationCodeGranter.createPredicate("user:info,device:query");
|
||||
BiPredicate<Permission, String> predicate = DefaultAuthorizationCodeGranter.createPredicate("user:info device:query");
|
||||
|
||||
{
|
||||
SimplePermission permission=new SimplePermission();
|
||||
|
||||
Reference in New Issue
Block a user