mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
23 lines
552 B
TypeScript
23 lines
552 B
TypeScript
import { DashboardState } from 'app/types';
|
|
import { Action, ActionTypes } from './actions';
|
|
import { processAclItems } from 'app/core/utils/acl';
|
|
|
|
export const initialState: DashboardState = {
|
|
permissions: [],
|
|
};
|
|
|
|
export const dashboardReducer = (state = initialState, action: Action): DashboardState => {
|
|
switch (action.type) {
|
|
case ActionTypes.LoadDashboardPermissions:
|
|
return {
|
|
...state,
|
|
permissions: processAclItems(action.payload),
|
|
};
|
|
}
|
|
return state;
|
|
};
|
|
|
|
export default {
|
|
dashboard: dashboardReducer,
|
|
};
|