IsUserInAnyRole

Description

Determines whether an authenticated user belongs to any role in a list of roles.

Returns

True, if the authenticated user, belongs to any Role in the list; False, otherwise.

Category

IsUserInAnyRole(role_list)

See also

cflogincfloginusercflogoutGetAuthUserGetUserRolesIsUserInRoleIsUserLoggedInSecuring Applications in the Developing ColdFusion Applications

History

ColdFusion 8: Added this function.

Parameters

Parameter

Description

role_list

A comma-delimited list of one or more roles to be tested.

Example

 

<cfif IsUserInAnyRole(allRoles) > 
<cfoutput>Authenticated user is in these roles: #GetUserRoles()#</cfoutput> 
<cfelseif > 
<cfoutput>Authenticated user is in no roles</cfoutput> 
</cfif>
Not:

From ColdFusion 11 onwards, this function is not applicable when a user is logged in using Admin API. 

 Adobe

Daha hızlı ve daha kolay yardım alın

Yeni kullanıcı mısınız?

Adobe MAX 2024

Adobe MAX
Yaratıcılık Konferansı

14–16 Ekim Miami Beach ve çevrimiçi

Adobe MAX

Yaratıcılık Konferansı

14–16 Ekim Miami Beach ve çevrimiçi

Adobe MAX 2024

Adobe MAX
Yaratıcılık Konferansı

14–16 Ekim Miami Beach ve çevrimiçi

Adobe MAX

Yaratıcılık Konferansı

14–16 Ekim Miami Beach ve çevrimiçi