IsProtected(resourcetype, resourcename [, action])
Returns TRUE if a resource is protected in an authenticated user's security context.
IsProtected
returns true if the resource is protected by a rule in the security context or sandbox within which a request is processed. An application may have to determine whether a resource is protected and if the current user is authorized to use it. If a resource is not protected, IsAuthorized returns true. To determine whether a resource is explicitly protected with a rule, you must use IsProtected
.
<!--- This example calls the IsProtected function. ---> ... <!-------------------------------------------------------------------- The following code checks whether the Orders data source is protected. If the data source is protected, the code then checks whether the current user is authorized to select information from the datasource. ----------------------------------------------------------------------> <cfif IsProtected("DATASOURCE", "Orders", "select")> <cfif IsAuthorized("DATASOURCE", "Orders", "select")> <cfquery name = "GetList" datasource = "Orders"> SELECT * FROM Orders </cfquery> <cfoutput QUERY = "GetList"> Authorization Succeeded. Order information follows: #Customer# - #BalanceDue#<BR> </cfoutput> </cfif> </cfif> </body> </html>