Sha256: d8c5300c5950ed563875c88a31e0897032663f3c07bd5e666566bb3c5dc6a356
Contents?: true
Size: 692 Bytes
Versions: 2
Compression:
Stored size: 692 Bytes
Contents
module Sufia # Creates AdminSets class AdminSetCreateService # @param admin_set [AdminSet] the admin set to operate on # @param creating_user [User] the user who created the admin set. def initialize(admin_set, creating_user) @admin_set = admin_set @creating_user = creating_user end attr_reader :creating_user, :admin_set # Creates an admin set, setting the creator and the default access controls. # @return [TrueClass, FalseClass] true if it was successful def create admin_set.read_groups = ['public'] admin_set.edit_groups = ['admin'] admin_set.creator = [creating_user.user_key] admin_set.save end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sufia-7.3.0.rc2 | app/services/sufia/admin_set_create_service.rb |
sufia-7.3.0.rc1 | app/services/sufia/admin_set_create_service.rb |