The Internet of Things (IoT) connects many objects and allows continuous communication and data sharing has emerged as a revolutionary technology. However, expanding IoT devices has raised concerns regarding data security and access control. Traditional access control mechanisms face challenges in managing access rights, particularly in scenarios where multiple users with the same roles try to access several resources which may lead to conflicting roles. Additionally, there is also an overhead of system performance using traditional approaches. In existing studies, the main problem of conflict roles is not addressed or not even identified appropriately. This paper proposes a framework to address these challenges using blockchain technology and role-based access control with a smart contract implementation on the hyperledger fabric framework. The proposed methodology introduces a role management system that resolves conflicts based on predefined rules and user preferences. It employs a consensus mechanism to determine access permissions, ensuring fairness and accountability. The findings demonstrate that applying the suggested framework eliminates conflicting problems, improves system security and also provides better results in response times of twelve seconds on average for thirty-five concurrent user requests. It also provides a secure and transparent access control framework which improves response time and provides security based on roles.