if user is nil, pass nil for user_id instead of causing an exception
if user is nil, pass nil for user_id instead of causing an exception

Signed-off-by: Steffen Bartsch <bc4b91223a16458800444a2ba965aaa300f08174@tzi.org>

tatarsky-v/declarative_authorization,breckenedge/declarative_authorization,NetsoftHoldings/declarative_authorization,cthielen/declarative_authorization,myteksi/declarative_authorization,myteksi/declarative_authorization,mcartmell/declarative_authorization,breckenedge/declarative_authorization,Xymist/declarative_authorization,mcartmell/declarative_authorization,cthielen/declarative_authorization,mobi/declarative_authorization,zeiv/declarative_authorization,Xymist/declarative_authorization,tatarsky-v/declarative_authorization,stffn/declarative_authorization,NetsoftHoldings/declarative_authorization,zeiv/declarative_authorization,mobi/declarative_authorization