2017-11-24 20:44:52 +00:00
|
|
|
import * as types from '../constants/types';
|
|
|
|
|
|
|
|
const initialState = {
|
|
|
|
permissions: {}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default function permissions(state = initialState.permissions, action) {
|
|
|
|
if (action.type === types.SET_ALL_PERMISSIONS) {
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
...action.payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-12-27 15:22:06 +00:00
|
|
|
if (action.type === types.ADD_PERMISSIONS) {
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
...action.payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-11-24 20:44:52 +00:00
|
|
|
return state;
|
|
|
|
}
|