Adding/associate a new privilege to a user

Good afternoon,

The part of create a privilege i have no questions, But my big question is witch part of code is adding/associate the new privilege to a user/role?

Best Regards, Hugo

@meizzz are you’re asking for how to add a new privilege to a user? If yes, you need to add the privilege to the one of the roles assigned to the user. The way User is modeled, a user can have 1 or more roles assigned to them therefore the individual privileges are added to the roles and not the user directly.