akkounts/app/services/ldap_manager/update_pgp_key.rb
Râu Cao 3042a02a17
All checks were successful
continuous-integration/drone/push Build is passing
Allow users to update their OpenPGP pubkey
2024-09-23 18:13:39 +02:00

17 lines
305 B
Ruby

module LdapManager
class UpdatePgpKey < LdapManagerService
def initialize(dn:, pubkey:)
@dn = dn
@pubkey = pubkey
end
def call
if @pubkey.present?
replace_attribute @dn, :pgpKey, @pubkey
else
delete_attribute @dn, :pgpKey
end
end
end
end