def check(self, user, permission, obj=_nothing):
if not self.allows(user, permission, obj):<EOL><INDENT>raise AuthorizationError(<EOL>'<STR_LIT>'.format(<EOL>permission, type(obj)))<EOL><DEDENT>
Raises AuthorizationError when a user has no permission.

        :param user: a user.
        :param permission: permission to check.
        :param obj: (optional) an object to check permission for.