app/models/auth_token.rb
# Walk the permission tree to see if the record can be changed. Can take an
# instance of #Record, or just the name of the RR (with/without the domain
# name)
Walk the permission tree to see if the record can be changed. Can take an
instance of #Record, or just the name of the RR (with/without the domain
name)
Walk the permission tree to see if the record can be changed . Can take an instance of #Record or just the name of the RR ( with / without the domain name )
def can_change?( record, type = '*' )
    name, type = get_name_and_type_from_param( record, type )
    return false if type == 'NS' || type == 'SOA'
    return false if self.permissions['protected_types'].include?( type )
    return false if self.permissions['protected'].detect do |r|
      r[0] == name && (r[1] == type || r[1] == '*' || type == '*')
    end
    return true if self.permissions['allowed'].detect do |r|
      r[0] == name && (r[1] == type || r[1] == '*' || type == '*')
    end
    return self.permissions['policy'] == 'allow'
  end
def can_change? ( record , type = '*' ) name , type = get_name_and_type_from_param ( record , type ) return false if type == 'NS' || type == 'SOA' return false if self . permissions [ 'protected_types' ] . include? ( type ) return false if self . permissions [ 'protected' ] . detect do | r | r [ 0 ] == name && ( r [ 1 ] == type || r [ 1 ] == '*' || type == '*' ) end return true if self . permissions [ 'allowed' ] . detect do | r | r [ 0 ] == name && ( r [ 1 ] == type || r [ 1 ] == '*' || type == '*' ) end return self . permissions [ 'policy' ] == 'allow' end
Walk the permission tree to see if the record can be changed.
Walk the permission tree to see if the record can be changed .
# NS records? # Type protected? # RR protected? # Allowed? # Default policy
record
<not_specific>
type
<not_specific>