It is not legal to give your boarding pass to someone else. It is a non-transferrable document. This is why your boarding pass is checked against your ID at security checkpoints. Your boarding pass indicates the level of security screening you face, which is particular to the individual identified on it.