mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-06 14:15:50 +08:00
增加AuthorizationInitializeEvent
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
|
||||
package org.hswebframework.web.authorization;
|
||||
|
||||
import org.hswebframework.web.authorization.listener.event.AuthorizationInitializeEvent;
|
||||
|
||||
/**
|
||||
* 授权信息初始化服务接口,使用该接口初始化用的权限信息
|
||||
*
|
||||
@@ -30,6 +32,7 @@ public interface AuthenticationInitializeService {
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 权限信息
|
||||
* @see AuthorizationInitializeEvent
|
||||
*/
|
||||
Authentication initUserAuthorization(String userId);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import org.hswebframework.web.authorization.Authentication;
|
||||
import org.hswebframework.web.authorization.AuthenticationInitializeService;
|
||||
import org.hswebframework.web.authorization.Permission;
|
||||
import org.hswebframework.web.authorization.access.DataAccessConfig;
|
||||
import org.hswebframework.web.authorization.listener.event.AuthorizationInitializeEvent;
|
||||
import org.hswebframework.web.authorization.simple.SimpleAuthentication;
|
||||
import org.hswebframework.web.authorization.simple.SimplePermission;
|
||||
import org.hswebframework.web.authorization.simple.SimpleRole;
|
||||
@@ -440,7 +441,7 @@ public class SimpleAuthorizationSettingService extends GenericEntityService<Auth
|
||||
.listNoPaging();
|
||||
|
||||
authentication.setPermissions(initPermission(detailList));
|
||||
|
||||
eventPublisher.publishEvent(new AuthorizationInitializeEvent(authentication));
|
||||
return authentication;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user