diff --git a/ui/src/views/dashboard/playbooks.vue b/ui/src/views/dashboard/playbooks.vue
index f491a154..f513c450 100644
--- a/ui/src/views/dashboard/playbooks.vue
+++ b/ui/src/views/dashboard/playbooks.vue
@@ -34,6 +34,11 @@
icon="edit"
@click="edit(record)"
>
+
+
+
+
+
+ ---
+ Owner
+ Group
+ Others
+
+
+ Use
+
+ updateChecked(e, 0)"
+ />
+
+
+ updateChecked(e, 1)"
+ />
+
+
+ updateChecked(e, 2)"
+ />
+
+
+
+ Manage
+
+ updateChecked(e, 3)"
+ />
+
+
+ updateChecked(e, 4)"
+ />
+
+
+ updateChecked(e, 5)"
+ />
+
+
+
+ Admin
+
+ updateChecked(e, 6)"
+ />
+
+
+ updateChecked(e, 7)"
+ />
+
+
+ updateChecked(e, 8)"
+ />
+
+
+
+
@@ -64,6 +149,9 @@ export default {
pool: [],
+ access_editable: {},
+ access_editor_visible: false,
+
columns: [
{
dataIndex: "id",
@@ -94,6 +182,12 @@ export default {
};
},
computed: {
+ permissions() {
+ if (!this.access_editable.permissions) return [];
+ return this.access_editable.permissions
+ .split("")
+ .map((e) => (e == "1" ? true : false));
+ },
...mapGetters(["credentials"]),
},
methods: {
@@ -134,6 +228,49 @@ export default {
this.edit_visible = false;
this.editable = {};
},
+
+ save_access() {
+ this.$axios({
+ method: "post",
+ url: `/ansible/${this.access_editable.id}/action`,
+ auth: this.credentials,
+ data: {
+ action: {
+ perform: "update",
+ params: {
+ extra_data: { PERMISSIONS: this.access_editable.permissions },
+ },
+ },
+ },
+ }).then(() => {
+ this.$notification.success({
+ message: "Success",
+ description: "Permissions updated successfuly",
+ });
+ this.handleAccessEditorClose();
+ this.sync();
+ });
+ },
+ edit_access(record) {
+ this.access_editable = {
+ id: record.id,
+ permissions: record.extra_data.PERMISSIONS,
+ };
+ this.access_editor_visible = true;
+ },
+ updateChecked(e, num) {
+ let p = this.permissions;
+ p[num] = e.target.checked;
+ this.$set(
+ this.access_editable,
+ "permissions",
+ p.map((e) => (e ? "1" : "0")).join("")
+ );
+ },
+ handleAccessEditorClose() {
+ this.access_editor_visible = false;
+ this.access_editable = {};
+ },
},
mounted() {
this.$store.dispatch("sync_user_pool");