legal ground
Article 386 of the Civil Code
Unless otherwise provided by law, when the debtor fails to perform the due debt or the security interest agreed by the parties is realized, the holder of the security interest has the right to be paid in priority for the secured property.
Article 387 1
Where a creditor needs security in order to ensure the realization of his creditor's rights in civil activities such as lending, buying and selling, he may establish a security interest in accordance with the provisions of this Law and other laws.