Add permission checks to account and QNA pages
- Add grant check (46, 'X') to password change navigation handlers - Add grant check (45, 'X') to user management save/add operations - Add grant check (64, 'X') to QNA registration - Refactor inline onClick handlers to separate methods for better maintainability - Add debug logging to checkGrant function Changes: - password-manage-wrap: Extract changeLoginPassword and changeCancelPassword methods - user-account-auth-wrap: Extract handleSave method with permission check - user-login-auth-info-wrap: Add permission check to handleSave - user-manage-wrap: Add permission check to onClickToNavigation, simplify onClick - qna/register-page: Add permission check to onClickToRegisterQna 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,9 @@ import { useStore } from "../model/store";
|
||||
export const checkGrant = (menuId?: number, authType: string = 'R') => {
|
||||
const menuGrantsByKey = useStore.getState().UserStore.menuGrantsByKey;
|
||||
const myGrants = menuGrantsByKey['' + menuId];
|
||||
|
||||
console.log('checkGrant', menuId, authType, myGrants);
|
||||
|
||||
if(myGrants?.includes(authType) || menuId === -1){
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user