Compare commits

...

4 Commits

Author SHA1 Message Date
vikrantgupta25
1a7ea098a4 feat: log the create new dashboard permissions 2024-12-03 17:40:08 +05:30
Vikrant Gupta
1934f743d6 Merge branch 'develop' into debugging-rbac-issue 2024-12-03 14:36:29 +05:30
vikrantgupta25
08ef66e185 chore: logging 2024-12-03 14:35:05 +05:30
vikrantgupta25
bb4c42ec22 chore: added debug statements for rbac issue 2024-12-03 14:27:24 +05:30
3 changed files with 8 additions and 2 deletions

View File

@@ -46,7 +46,8 @@ const afterLogin = async (
});
const { payload } = getUserResponse;
// TODO remove this later, logging the role for debugging some issue
console.trace('[getUserResponse]:', payload);
store.dispatch<AppActions>({
type: UPDATE_USER,
payload: {

View File

@@ -95,8 +95,10 @@ function DashboardsList(): JSX.Element {
refetch: refetchDashboardList,
} = useGetAllDashboard();
const { role } = useSelector<AppState, AppReducer>((state) => state.app);
const { role, user } = useSelector<AppState, AppReducer>((state) => state.app);
// TODO remove this later, logging the role for debugging some issue
console.info(user?.email, 'has role', role);
const {
listSortOrder: sortOrder,
setListSortOrder: setSortOrder,
@@ -109,6 +111,8 @@ function DashboardsList(): JSX.Element {
['action', 'create_new_dashboards'],
role,
);
// log the permissions to createNewDashboard
console.info('createNewDashboard permission: ', createNewDashboard);
const [
showNewDashboardTemplatesModal,

View File

@@ -2145,6 +2145,7 @@ func (aH *APIHandler) getUser(w http.ResponseWriter, r *http.Request) {
// No need to send password hash for the user object.
user.Password = ""
zap.L().Info("[getUser] Response:", zap.String("userId", user.Id), zap.String("email", user.Email), zap.String("role", user.Role))
aH.WriteJSON(w, r, user)
}