check roles
This commit is contained in:
parent
1adbca1582
commit
761dea73aa
|
@ -13,12 +13,20 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {ROLE_TEST_MANAGER, ROLE_TEST_USER, ROLE_TEST_VIEWER} from "../../../common/constants";
|
||||
|
||||
export default {
|
||||
name: "MsRecentProject",
|
||||
mounted() {
|
||||
this.$get('/project/recent/5', (response) => {
|
||||
this.recentProjects = response.data;
|
||||
});
|
||||
const rolesString = localStorage.getItem("roles");
|
||||
const roles = rolesString.split(',');
|
||||
|
||||
if (roles.indexOf(ROLE_TEST_MANAGER) > -1 || roles.indexOf(ROLE_TEST_USER) > -1 || roles.indexOf(ROLE_TEST_VIEWER) > -1) {
|
||||
this.$get('/project/recent/5', (response) => {
|
||||
this.recentProjects = response.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {},
|
||||
data() {
|
||||
|
|
|
@ -11,12 +11,20 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {ROLE_TEST_MANAGER, ROLE_TEST_USER, ROLE_TEST_VIEWER} from "../../../common/constants";
|
||||
|
||||
export default {
|
||||
name: "MsRecentTestPlan",
|
||||
mounted() {
|
||||
this.$get('/testplan/recent/5', (response) => {
|
||||
this.recentTestPlans = response.data;
|
||||
});
|
||||
const rolesString = localStorage.getItem("roles");
|
||||
const roles = rolesString.split(',');
|
||||
|
||||
if (roles.indexOf(ROLE_TEST_MANAGER) > -1 || roles.indexOf(ROLE_TEST_USER) > -1 || roles.indexOf(ROLE_TEST_VIEWER) > -1) {
|
||||
this.$get('/testplan/recent/5', (response) => {
|
||||
this.recentTestPlans = response.data;
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue