--- title: "hasRole" slug: "user-hasrole" updated: 2025-11-06T18:55:36Z published: 2025-11-06T18:55:36Z canonical: "docs.doc-know.com/user-hasrole" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.doc-know.com/llms.txt > Use this file to discover all available pages before exploring further. # hasRole ### user.hasRole Type: **Boolean** Returns whether or not the user belongs to a specified security role. ### Examples ``` // take action if user belongs to a specific role if (user.hasRole("prep")) debug.log("User belongs to the prep role!"); ``` ``` // display if the user has the 'prep' role debug.log(user.hasRole("prep")); ``` ### Remarks Definition A **role** is a security term that refers to a type of user and the set of permissions they have. IT administrators assign **roles** to **users** (according to their job specifications) when the user's account is first set up or when management requests changes. These roles often dictate which product features a user can access. For example, a Dr. Know user could be a **technician** using your app to collect certain data elements during patient testing. Later, a **physician** might use your app to review this information and complete a report. Each user would belong to a distinct role. Users can also belong to more than one role. You can use this information within your scripts to deliver role-specific features and user experience enhancements.