diff --git a/ipaserver/plugins/trust.py b/ipaserver/plugins/trust.py index 9c4bb5f8b..42fcc49bf 100644 --- a/ipaserver/plugins/trust.py +++ b/ipaserver/plugins/trust.py @@ -1872,7 +1872,8 @@ class trust_enable_agent(Command): # the user must have the Replication Administrators privilege privilege = u'Replication Administrators' - if not principal_has_privilege(self.api, context.principal, privilege): + op_account = getattr(context, 'principal', None) + if not principal_has_privilege(self.api, op_account, privilege): raise errors.ACIError( info=_("not allowed to remotely add agent"))