my dock menu always be added "Quit" and other 2 menu items automatically, how may I block / modify them?

updated:

really NO way to delete/block/redirect the "Quit" menu item.
used Peter's recommendation at last like blow
hope helpful to others

```
-(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
{
    if (needPassword)
    {
        [self checkPassword:self];
        return  NSTerminateCancel;
    }
    else 
    {
        return NSTerminateNow;
    }
}

-(void)checkPassword:(id)sender
{
    if(passwordCorrect)
    {   
        !needPassword;
            [[NSApplication sharedApplication] terminate:self];
    }
}

```