|
@@ -105,6 +105,8 @@
|
|
|
|
|
|
<script>
|
|
|
import { CORE_API } from "@/constants/constants";
|
|
|
+import { mapState } from "vuex";
|
|
|
+
|
|
|
export default {
|
|
|
name: "UserCopyPrevillegeDialog",
|
|
|
props: {
|
|
@@ -127,9 +129,30 @@ export default {
|
|
|
total: 10,
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapState({
|
|
|
+ user: (state) => state.user,
|
|
|
+ }),
|
|
|
+ isOrgAdminNotSuperAdmin() {
|
|
|
+ return (
|
|
|
+ this.user.roleList.some((role) => role.roleCode == "ORG_ADMIN") &&
|
|
|
+ !this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN")
|
|
|
+ );
|
|
|
+ },
|
|
|
+ isSuperAdminOrOrgAdmin() {
|
|
|
+ return this.user.roleList.some(
|
|
|
+ (role) => role.roleCode == "SUPER_ADMIN" || role.roleCode == "ORG_ADMIN"
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
async search() {
|
|
|
var param = new URLSearchParams(this.form);
|
|
|
+ if (!this.isSuperAdminOrOrgAdmin)
|
|
|
+ param.append("ignoreRoleCodes", "SUPER_ADMIN,ORG_ADMIN");
|
|
|
+ else if (this.isOrgAdminNotSuperAdmin) {
|
|
|
+ param.append("ignoreRoleCodes", "SUPER_ADMIN");
|
|
|
+ }
|
|
|
var url =
|
|
|
CORE_API +
|
|
|
"/user/all/" +
|