Skip to content

Commit

Permalink
Merge pull request #1020 from sjd78/roles-and-templates
Browse files Browse the repository at this point in the history
Fetch roles and permit at login and do entity permission to permit mapping on frontend
  • Loading branch information
sjd78 committed Mar 18, 2020
2 parents 5730970 + 96baff0 commit bcb6072
Show file tree
Hide file tree
Showing 17 changed files with 576 additions and 472 deletions.
1 change: 1 addition & 0 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export * from './activeRequests'
export * from './console'
export * from './userMessages'
export * from './disks'
export * from './roles'

export function appConfigured () {
return { type: APP_CONFIGURED }
Expand Down
20 changes: 20 additions & 0 deletions src/actions/roles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {
GET_ROLES,
SET_ROLES,
} from '_/constants'

export function setRoles (roles) {
return {
type: SET_ROLES,
payload: {
roles,
},
}
}

export function getRoles () {
return {
type: GET_ROLES,
payload: {},
}
}
42 changes: 0 additions & 42 deletions src/actions/templates.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,12 @@
import {
GET_ALL_TEMPLATES,
SET_TEMPLATES,
TEMPLATE_GET_DISKS,
TEMPLATE_GET_NICS,
TEMPLATE_SET_DISKS,
TEMPLATE_SET_NICS,
} from '_/constants'

export function getTemplateDisks (templateId) {
return {
type: TEMPLATE_GET_DISKS,
payload: {
templateId,
},
}
}

export function getTemplateNics (templateId) {
return {
type: TEMPLATE_GET_NICS,
payload: {
templateId,
},
}
}

export function getAllTemplates () {
return { type: GET_ALL_TEMPLATES }
}

export function setTemplateDisks (templateId, disks) {
return {
type: TEMPLATE_SET_DISKS,
payload: {
templateId,
disks,
},
}
}

export function setTemplateNics (templateId, nics) {
return {
type: TEMPLATE_SET_NICS,
payload: {
templateId,
nics,
},
}
}

export function setTemplates (templates) {
return {
type: SET_TEMPLATES,
Expand Down
6 changes: 2 additions & 4 deletions src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const GET_POOL = 'GET_POOL'
export const GET_POOLS_BY_COUNT = 'GET_POOLS_BY_COUNT'
export const GET_POOLS_BY_PAGE = 'GET_POOLS_BY_PAGE'
export const GET_RDP_VM = 'GET_RDP_VM'
export const GET_ROLES = 'GET_ROLES'
export const GET_USER_GROUPS = 'GET_USER_GROUPS'
export const GET_VM = 'GET_VM'
export const GET_VM_CDROM = 'GET_VM_CDROM'
Expand Down Expand Up @@ -90,6 +91,7 @@ export const SET_HOSTS = 'SET_HOSTS'
export const SET_OPERATING_SYSTEMS = 'SET_OPERATING_SYSTEMS'
export const SET_OVIRT_API_VERSION = 'SET_OVIRT_API_VERSION'
export const SET_PAGE = 'SET_PAGE'
export const SET_ROLES = 'SET_ROLES'
export const SET_STORAGE_DOMAIN_FILES = 'SET_STORAGE_DOMAIN_FILES'
export const SET_STORAGE_DOMAINS = 'SET_STORAGE_DOMAINS'
export const SET_TEMPLATES = 'SET_TEMPLATES'
Expand Down Expand Up @@ -117,10 +119,6 @@ export const START_SCHEDULER_FIXED_DELAY = 'START_SCHEDULER_FIXED_DELAY'
export const START_VM = 'START_VM'
export const STOP_SCHEDULER_FIXED_DELAY = 'STOP_SCHEDULER_FIXED_DELAY'
export const SUSPEND_VM = 'SUSPEND_VM'
export const TEMPLATE_GET_DISKS = 'TEMPLATE_GET_DISKS'
export const TEMPLATE_GET_NICS = 'TEMPLATE_GET_NICS'
export const TEMPLATE_SET_DISKS = 'TEMPLATE_SET_DISKS'
export const TEMPLATE_SET_NICS = 'TEMPLATE_SET_NICS'
export const UPDATE_ICONS = 'UPDATE_ICONS'
export const UPDATE_POOLS = 'UPDATE_POOLS'
export const UPDATE_VM_SNAPSHOT = 'UPDATE_VM_SNAPSHOT'
Expand Down
Loading

0 comments on commit bcb6072

Please sign in to comment.