Story #105846070 - do not allow user to see other user's domains if their ident values have the same code

This commit is contained in:
Matt Farnsworth 2015-12-14 16:55:22 +02:00
parent 13f50dec8c
commit 05c4aaf3f1

View file

@ -12,10 +12,15 @@ class RegistrantUser < User
end
def domains
Domain.includes(:registrar, :registrant).where(contacts: {ident: ident})
# TODO: move data to normal columns and drop registrant_ident
ident_cc, ident = @current_user.registrant_ident.split '-'
Domain.includes(:registrar, :registrant).where(contacts: {
ident_type: 'priv',
ident: ident, #identity_code,
ident_country_code: ident_cc #country_code
})
end
def to_s
username
end