Skip to content

Commit

Permalink
Merge pull request #140 from hs-web/3.0.x
Browse files Browse the repository at this point in the history
3.0.x
  • Loading branch information
zhou-hao committed Sep 4, 2019
2 parents c7ff97e + 0cf1bfa commit 9eb96c4
Show file tree
Hide file tree
Showing 166 changed files with 835 additions and 375 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: java
sudo: false
jdk:
- oraclejdk8
- openjdk8
before_install:
- chmod +x mvnw
script:
Expand Down
2 changes: 1 addition & 1 deletion hsweb-authorization/hsweb-authorization-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-authorization</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

package org.hswebframework.web.authorization;

import org.hswebframework.web.authorization.listener.event.AuthorizationInitializeEvent;

/**
* 授权信息初始化服务接口,使用该接口初始化用的权限信息
*
Expand All @@ -30,6 +32,7 @@ public interface AuthenticationInitializeService {
*
* @param userId 用户ID
* @return 权限信息
* @see AuthorizationInitializeEvent
*/
Authentication initUserAuthorization(String userId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void setUsername(String username) {
}

public void setPassword(String password) {
super.username = password;
super.password = password;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.hswebframework.web.authorization.listener.event;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.hswebframework.web.authorization.Authentication;

@Getter
@AllArgsConstructor
public class AuthorizationInitializeEvent {

private Authentication authentication;
}
2 changes: 1 addition & 1 deletion hsweb-authorization/hsweb-authorization-basic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-authorization</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ protected void handleRBAC(Authentication authentication, AuthorizeDefinition def
Function<Predicate<Role>, Boolean> func = logicalIsOr
? authentication.getRoles().stream()::anyMatch
: authentication.getRoles().stream()::allMatch;
access = func.apply(role -> rolesDef.contains(role.getId()));

access = logicalIsOr
? access || func.apply(role -> rolesDef.contains(role.getId()))
: access && func.apply(role -> rolesDef.contains(role.getId()));
}
//控制用户
if (!usersDef.isEmpty()) {
Expand All @@ -211,7 +214,10 @@ protected void handleRBAC(Authentication authentication, AuthorizeDefinition def
Function<Predicate<String>, Boolean> func = logicalIsOr
? usersDef.stream()::anyMatch
: usersDef.stream()::allMatch;
access = func.apply(authentication.getUser().getUsername()::equals);
access = logicalIsOr
? access || func.apply(authentication.getUser().getUsername()::equals)
: access && func.apply(authentication.getUser().getUsername()::equals);

}
if (!access) {
throw new AccessDenyException(definition.getMessage());
Expand Down
2 changes: 1 addition & 1 deletion hsweb-authorization/hsweb-authorization-jwt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-authorization</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>hsweb-authorization-oauth2</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>hsweb-authorization-oauth2</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>hsweb-authorization-oauth2</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
<!--<relativePath>../../pom.xml</relativePath>-->
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion hsweb-authorization/hsweb-authorization-oauth2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-authorization</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion hsweb-authorization/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion hsweb-boost/hsweb-boost-aop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>hsweb-boost</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion hsweb-boost/hsweb-boost-excel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-boost</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion hsweb-boost/hsweb-boost-ftp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-boost</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion hsweb-boost/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion hsweb-commons/hsweb-commons-bean/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-commons</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion hsweb-commons/hsweb-commons-controller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>hsweb-commons</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>hsweb-commons-dao</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>hsweb-commons-dao</artifactId>
<groupId>org.hswebframework.web</groupId>
<version>3.0.8</version>
<version>3.0.9</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Loading

0 comments on commit 9eb96c4

Please sign in to comment.