  def add_group( group, role )
    check_write_access!
    unless role.kind_of? Role
      role = Role.get_by_title(role)
    end

    if role.global
      #only nonglobal roles may be set in a project
      raise SaveError, "tried to set global role '#{role_title}' for group '#{group}' in package '#{self.name}'"
    end

    unless group.kind_of? Group
      group = Group.find_by_title(group.to_s)
    end

    PackageGroupRoleRelationship.create(
                                        :package => self,
                                        :group => group,
                                        :role => role )
  end
Weaknesses in this category are related to improper assignment or handling of permissions.