This repository was archived by the owner on Mar 30, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +73
-3
lines changed Expand file tree Collapse file tree 7 files changed +73
-3
lines changed Original file line number Diff line number Diff line change 2
2
* Vuex modules
3
3
*/
4
4
import { store as auth } from 'genesis/modules/auth/index'
5
+ import { store as permission } from 'genesis/modules/permission/index'
5
6
import { store as dashboard } from 'genesis/modules/dashboard/index'
6
7
7
8
export default {
8
- auth, dashboard
9
+ auth, permission , dashboard
9
10
}
Original file line number Diff line number Diff line change
1
+ export { default as store } from 'genesis/modules/permission/store'
Original file line number Diff line number Diff line change
1
+ import store from 'genesis/infra/store'
2
+ import { promise } from 'genesis/support/utils'
3
+
4
+ /**
5
+ * @param {Object } user
6
+ * @param {Function } success
7
+ * @returns {Promise }
8
+ */
9
+ export const setPermissions = ( permissions , success = ( ) => ( { } ) ) => {
10
+ return store . dispatch ( 'setAuthPermission' , permissions ) . then ( success )
11
+ }
12
+
13
+ /**
14
+ * @param {Function } success
15
+ * @returns {Promise }
16
+ */
17
+ export const unPermissions = ( success ) => {
18
+ return promise ( ( resolve , reject ) => {
19
+ const solver = ( ) => {
20
+ success ( )
21
+ resolve ( )
22
+ }
23
+ store
24
+ . dispatch ( 'setAuthPermission' , undefined )
25
+ . then ( store . dispatch ( 'setAppMenu' , [ ] ) . then ( solver ) . catch ( reject ) )
26
+ . catch ( reject )
27
+ } )
28
+ }
Original file line number Diff line number Diff line change
1
+ import { APP_PERMISSIONS } from 'genesis/support/index'
2
+ import { set } from 'genesis/infra/storage'
3
+
4
+ export const SET_PERMISSION = 'setAuthPermission'
5
+
6
+ const state = {
7
+ permissions : undefined
8
+ }
9
+
10
+ const getters = {
11
+ getAuthPermission : ( state ) => state . permissions
12
+ }
13
+
14
+ const actions = {
15
+ setAuthPermission : ( store , permissions ) => {
16
+ store . commit ( SET_PERMISSION , permissions )
17
+ set ( APP_PERMISSIONS , permissions , false )
18
+ }
19
+ }
20
+
21
+ const mutations = {
22
+ [ SET_PERMISSION ] ( state , permissions ) {
23
+ state . permissions = permissions
24
+ }
25
+ }
26
+
27
+ export default {
28
+ state,
29
+ getters,
30
+ actions,
31
+ mutations
32
+ }
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " genesis" ,
3
- "version" : " 0.1.2 " ,
3
+ "version" : " 0.1.3 " ,
4
4
"description" : " RAD dashboard tools using Quasar" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
7
7
"test" : " echo \" Error: no test specified\" && exit 1"
8
8
},
9
9
"author" : " William Correa <wilcorrea@gmail.com>" ,
10
10
"license" : " MIT"
11
- }
11
+ }
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ export const APP_NAME = env.APP.NAME
9
9
10
10
export const APP_USER = env . APP . USER
11
11
12
+ export const APP_PERMISSIONS = env . APP . PERMISSIONS
13
+
12
14
export const APP_TOKEN = env . APP . TOKEN
13
15
14
16
export const APP_REMEMBER = env . APP . REMEMBER
Original file line number Diff line number Diff line change @@ -110,6 +110,12 @@ export const standard = {
110
110
}
111
111
return this
112
112
} ,
113
+ $comma ( key ) {
114
+ this . grid . format = ( value ) => {
115
+ return value . map ( c => c [ key ] ) . join ( ', ' )
116
+ }
117
+ return this
118
+ } ,
113
119
$checkbox ( ) {
114
120
this . form . component = 'checkbox'
115
121
this . grid . format = formatBoolean
You can’t perform that action at this time.
0 commit comments