IsUserInRole

Description

Determines whether an authenticated user belongs to the specified Role.

Return value

True, if the authenticated user, belongs to the specified Role; False, otherwise.

Category

Authentication functions, Decision functions

Syntax

IsUserInRole("role_name") 

See also

GetAuthUser

History

New in ColdFusion MX: This function is new.

Parameters

Parameter Description
role_name
Name of a security role

Example

<cfif isUserInRole("Admin") > 
  <cfoutput>Authenticated user is an administrator</cfoutput> 
<cfelse isUserInRole("User") > 
  <cfoutput>Authenticated user is a user</cfoutput> 
</cfif>

Comments