-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
118 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
export const setAuthStatus = ({commit}) => { | ||
commit('setAuthStatus'); | ||
}; | ||
export const setAuthUserDetail = ({commit}, auth) => { | ||
commit('setAuthUserDetail', auth); | ||
}; | ||
export const resetAuthUserDetail = ({commit}) => { | ||
commit('resetAuthUserDetail'); | ||
}; | ||
export const setConfig = ({commit}, data) => { | ||
commit('setConfig', data); | ||
}; | ||
export const setPermission = ({commit}, data) => { | ||
commit('setPermission', data); | ||
}; | ||
export const resetConfig = ({commit}) => { | ||
commit('resetConfig', data); | ||
}; | ||
export const setTwoFactorCode = ({commit}, data) => { | ||
commit('setTwoFactorCode', data); | ||
}; | ||
export const resetTwoFactorCode = ({commit}) => { | ||
commit('resetTwoFactorCode'); | ||
}; | ||
export const setLastActivity = ({commit}) => { | ||
commit('setLastActivity'); | ||
}; | ||
export const setDefaultRole = ({commit}, data) => { | ||
commit('setDefaultRole', data) | ||
}; | ||
export const setSearchQuery = ({commit}, data) => { | ||
commit('setSearchQuery', data) | ||
}; | ||
|
||
export default { | ||
setAuthStatus, | ||
setAuthUserDetail, | ||
resetAuthUserDetail, | ||
setConfig, | ||
setPermission, | ||
resetConfig, | ||
setTwoFactorCode, | ||
resetTwoFactorCode, | ||
setLastActivity, | ||
setDefaultRole, | ||
setSearchQuery | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
export const getAuthUser = (state) => (name) => { | ||
return state.auth[name]; | ||
}; | ||
|
||
export const getAuthStatus = (state) => { | ||
return state.is_auth; | ||
}; | ||
|
||
export const hasRole = (state) => (name) => { | ||
return state.auth.roles.indexOf(name) >= 0 | ||
}; | ||
|
||
export const getConfig = (state) => (name) => { | ||
return state.config[name]; | ||
}; | ||
|
||
export const hasPermission = (state) => (name) => { | ||
return state.permissions.indexOf(name) > -1; | ||
}; | ||
|
||
export const getTwoFactorCode = (state) => { | ||
return state.two_factor_code; | ||
}; | ||
|
||
export const getLastActivity = (state) => { | ||
return state.last_activity; | ||
}; | ||
|
||
export const getDefaultRole = (state) => (name) => { | ||
return state.default_role[name]; | ||
}; | ||
|
||
export const getSearchQuery = (state) => { | ||
return state.search_query; | ||
}; | ||
|
||
export default { | ||
getAuthUser, | ||
getAuthStatus, | ||
hasRole, | ||
getConfig, | ||
hasPermission, | ||
getTwoFactorCode, | ||
getLastActivity, | ||
getDefaultRole, | ||
getSearchQuery, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters