human
Complete this python program:
def can_manage_own_profile(handler):
assistant
#Here is the Python program you requested.

    """Decorator to check whether user can manage his profile.
    """
    def test_can_manage_profile(self, **kwargs):
        if (not self.user_id):
            raise self.NotLoggedInException
        if (role_services.ACTION_MANAGE_PROFILE in self.actions):
            return handler(self, **kwargs)
        raise self.UnauthorizedUserException('You    do    not    have    credentials    to    manage    profile    or    preferences.')
    test_can_manage_profile.__wrapped__ = True
    return test_can_manage_profile