<commit_before>	class AccessControlStep < Hydrant::Workflow::BasicStep
		def initialize(step = 'access-control', 
                               title = "Access Control", 
                               summary = "Who can access the item", 
                               template = 'access_control')
		  super
		end

		def execute context
                  logger.debug "<<< In access control step: #{context.inspect} >>>"
		  mediaobject = context[:mediaobject]
	          # TO DO: Implement me
        	  logger.debug "<< Access flag = #{context[:access]} >>"
              	  mediaobject.access = context[:access] unless context[:access].blank? 

                  if context[:commit] == "Add"
                    if context[:scope] == "Group"
                      groups = mediaobject.group_exceptions
                      groups << context[:value] unless context[:value].blank?
                      mediaobject.group_exceptions = groups
                    elsif context[:scope] == "User"
                      users = mediaobject.user_exceptions
                      users << context[:value] unless context[:value].blank?
                      mediaobject.user_exceptions = users
                    end
                  elsif context[:commit] == "Delete"
                    if context[:scope] == "Group"
                      groups = mediaobject.group_exceptions
                      groups.delete context[:value] unless context[:value].blank?
                      mediaobject.group_exceptions = groups
                    elsif context[:scope] == "User"
                      users = mediaobject.user_exceptions
                      users.delete context[:value] unless context[:value].blank?<commit_msg>Fix user/group deletion<commit_after>	class AccessControlStep < Hydrant::Workflow::BasicStep
		def initialize(step = 'access-control', 
                               title = "Access Control", 
                               summary = "Who can access the item", 
                               template = 'access_control')
		  super
		end

		def execute context
                  logger.debug "<<< In access control step: #{context.inspect} >>>"
		  mediaobject = context[:mediaobject]
	          # TO DO: Implement me
        	  logger.debug "<< Access flag = #{context[:access]} >>"
              	  mediaobject.access = context[:access] unless context[:access].blank? 

                  unless context[:groups].blank?
                    groups = mediaobject.group_exceptions
                    context[:groups].each {|g| groups.delete g }
                    mediaobject.group_exceptions = groups
                  end                
                  unless context[:users].blank?
                    users = mediaobject.user_exceptions
                    context[:users].each {|u| users.delete u }
                    mediaobject.user_exceptions = users
                  end                

                  if context[:commit] == "Update"
                    if context[:scope] == "Group"
                      groups = mediaobject.group_exceptions
                      groups << context[:value] unless context[:value].blank?
                      mediaobject.group_exceptions = groups
                    elsif context[:scope] == "User"
                      users = mediaobject.user_exceptions
                      users << context[:value] unless context[:value].blank?
                      mediaobject.user_exceptions = users
                    end
                  elsif context[:commit] == "Delete"
                    if context[:scope] == "Group"
                      groups = mediaobject.group_exceptions
                      groups.delete context[:value] unless context[:value].blank?
                      mediaobject.group_exceptions = groups
                    elsif context[:scope] == "User"
                      users = mediaobject.user_exceptions
                      users.delete context[:value] unless context[:value].blank?
{'fraction_non_alphanumeric': 0.09154752947078003, 'fraction_numerical': 0.0, 'mean_word_length': 1.4331909701037218, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2210240', 'n_tokens_mistral': 917, 'n_tokens_neox': 840, 'n_words': 207}