def permission_attributes=(permissions)
      self.permissions = [] # Reset permissions in anticipation for re-population
    
      permissions.each do |key, value|
        key, value = key.dup, value.dup
      
        # Component Permissions
        if key.ends_with? "_permissions"
          grant_permissions(value)
        # Singular Permission
        elsif key.chomp! "_permission"
          grant_permissions(key) if value.to_i != 0
        end
      end
    end
def permission_attributes=(permissions)
      self.permissions = [] # Reset permissions in anticipation for re-population
    
      permissions.each do |key, value|
        key, value = key.dup, value.dup
      
        # Component Permissions
        if key.ends_with? "_permissions"
          grant_permissions(value)
        # Singular Permission
        elsif key.chomp! "_permission"
          grant_permissions(key) if value.to_i != 0
        end
      end
    end
Used by advanced permission forms which group permissions by their associated component
 or using a single check box per permission.