I wanted to document this as this error is not often found using google, but if you receive a ColdFusion error "The current user is not authorized to invoke this method.", it could be due to using the roles attribute in a cffunction tag that don't match the roles that you set using the cflogin tag upon successful login.
I received this error when converting the original application.cfm tag in BlogCfc to use an application.cfc instead. During the conversion processes, I noticed that there was a 'roles' argument on the cffunction that did not match up with the new role that I had just programmed in the cflogin logic. When I searched for this error, I found a bunch of errors relating to using ColdFusions built in administrative user interface, and could not find that it was due to the role restrictions on the cffunction tag and thought to document it.
It is a relatively intuitive error, but I am surprised that Adobe did not elaborate and write something like 'The role on the function does not match the cflogin role'. ColdFusion has always been good at that. If you receive this error, check the roles attributes that you have used. It will likely fix the problem.
This entry was posted on June 2, 2019 at 4:32 PM and has received 1693 views.