-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(extension/datapermission): 新增数据权限模块
- Loading branch information
Showing
16 changed files
with
320 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...w-starter-extension-datapermission/continew-starter-extension-datapermission-core/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>top.continew</groupId> | ||
<artifactId>continew-starter-extension-datapermission</artifactId> | ||
<version>${revision}</version> | ||
</parent> | ||
|
||
<artifactId>continew-starter-extension-datapermission-core</artifactId> | ||
<description>ContiNew Starter 扩展模块 - 数据权限 - 核心模块</description> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...top/continew/starter/extension/datapermission/autoconfigure/DataPermissionProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. | ||
* <p> | ||
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* <p> | ||
* http://www.gnu.org/licenses/lgpl.html | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package top.continew.starter.extension.datapermission.autoconfigure; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import top.continew.starter.core.constant.PropertiesConstants; | ||
|
||
/** | ||
* 数据权限配置属性 | ||
* | ||
* @author Charles7c | ||
* @since 2.7.0 | ||
*/ | ||
@ConfigurationProperties(PropertiesConstants.DATA_PERMISSION) | ||
public class DataPermissionProperties { | ||
|
||
/** | ||
* 是否启用多租户 | ||
*/ | ||
private boolean enabled = true; | ||
|
||
public boolean isEnabled() { | ||
return enabled; | ||
} | ||
|
||
public void setEnabled(boolean enabled) { | ||
this.enabled = enabled; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...n-core/src/main/java/top/continew/starter/extension/datapermission/model/RoleContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. | ||
* <p> | ||
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* <p> | ||
* http://www.gnu.org/licenses/lgpl.html | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package top.continew.starter.extension.datapermission.model; | ||
|
||
import top.continew.starter.extension.datapermission.enums.DataScope; | ||
|
||
/** | ||
* 角色上下文 | ||
* | ||
* @author Charles7c | ||
* @since 1.1.0 | ||
*/ | ||
public class RoleContext { | ||
|
||
/** | ||
* 角色 ID | ||
*/ | ||
private String roleId; | ||
|
||
/** | ||
* 数据权限 | ||
*/ | ||
private DataScope dataScope; | ||
|
||
public RoleContext() { | ||
} | ||
|
||
public RoleContext(String roleId, DataScope dataScope) { | ||
this.roleId = roleId; | ||
this.dataScope = dataScope; | ||
} | ||
|
||
public String getRoleId() { | ||
return roleId; | ||
} | ||
|
||
public void setRoleId(String roleId) { | ||
this.roleId = roleId; | ||
} | ||
|
||
public DataScope getDataScope() { | ||
return dataScope; | ||
} | ||
|
||
public void setDataScope(DataScope dataScope) { | ||
this.dataScope = dataScope; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.