forked from alibaba/nacos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve the issues of codestyle of nacos-config module for phase1 (al…
…ibaba#3250) * [ISSUE#3249]Resolve the part issues of codestyle for nacos-config module(package:aspect/auth/configuration). * [ISSUE#3249]Resolve the part issues of codestyle for nacos-config module(package:constant/controller). * [ISSUE#3249]translate Chinese comments into English. * [ISSUE#3249]fix typo.
- Loading branch information
1 parent
2f5fb23
commit c40de72
Showing
28 changed files
with
352 additions
and
156 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
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 |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
import static com.alibaba.nacos.config.server.service.repository.RowMapperManager.PERMISSION_ROW_MAPPER; | ||
|
||
/** | ||
* There is no self-augmented primary key | ||
* There is no self-augmented primary key. | ||
* | ||
* @author <a href="mailto:[email protected]">liaochuntao</a> | ||
*/ | ||
|
@@ -70,12 +70,26 @@ public Page<PermissionInfo> getPermissions(String role, int pageNo, int pageSize | |
return pageInfo; | ||
} | ||
|
||
/** | ||
* Execute ddd user permission operation. | ||
* | ||
* @param role role info string value. | ||
* @param resource resource info string value. | ||
* @param action action info string value. | ||
*/ | ||
public void addPermission(String role, String resource, String action) { | ||
String sql = "INSERT into permissions (role, resource, action) VALUES (?, ?, ?)"; | ||
EmbeddedStorageContextUtils.addSqlContext(sql, role, resource, action); | ||
databaseOperate.blockUpdate(); | ||
} | ||
|
||
/** | ||
* Execute delete user permission operation. | ||
* | ||
* @param role role info string value. | ||
* @param resource resource info string value. | ||
* @param action action info string value. | ||
*/ | ||
public void deletePermission(String role, String resource, String action) { | ||
String sql = "DELETE from permissions WHERE role=? and resource=? and action=?"; | ||
EmbeddedStorageContextUtils.addSqlContext(sql, role, resource, action); | ||
|
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 |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
import static com.alibaba.nacos.config.server.service.repository.RowMapperManager.ROLE_INFO_ROW_MAPPER; | ||
|
||
/** | ||
* There is no self-augmented primary key | ||
* There is no self-augmented primary key. | ||
* | ||
* @author <a href="mailto:[email protected]">liaochuntao</a> | ||
*/ | ||
|
@@ -85,6 +85,12 @@ public Page<RoleInfo> getRolesByUserName(String username, int pageNo, int pageSi | |
|
||
} | ||
|
||
/** | ||
* Add user role. | ||
* | ||
* @param role role string value. | ||
* @param userName username string value. | ||
*/ | ||
public void addRole(String role, String userName) { | ||
|
||
String sql = "INSERT into roles (role, username) VALUES (?, ?)"; | ||
|
@@ -97,6 +103,11 @@ public void addRole(String role, String userName) { | |
} | ||
} | ||
|
||
/** | ||
* Delete user role. | ||
* | ||
* @param role role string value. | ||
*/ | ||
public void deleteRole(String role) { | ||
String sql = "DELETE from roles WHERE role=?"; | ||
try { | ||
|
@@ -107,6 +118,12 @@ public void deleteRole(String role) { | |
} | ||
} | ||
|
||
/** | ||
* Execute delete role sql operation. | ||
* | ||
* @param role role string value. | ||
* @param username user string value. | ||
*/ | ||
public void deleteRole(String role, String username) { | ||
String sql = "DELETE from roles WHERE role=? and username=?"; | ||
try { | ||
|
Oops, something went wrong.