plone/plone.api — pull request #174 by adamcheasley (2014-08-12 13:44:35+00:00)
Title: grant_roles and revoke_roles errors

Currently, if a user cannot be looked up when calling either gran_roles or revoke_roles then next line that's hit is ``user.setSecurityProfile(roles=roles)`` if setting global roles. This will mean that the user variable is in fact a NoneType so you will get an AttributeError thrown.
This is a bit unexpected.

This changes checks that the user has been looked up and raises an InvalidParameterError instead.