  def add_user( user, 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 user '#{user}' in package '#{self.name}'"
    end

    unless user.kind_of? User
      user = User.get_by_login(user.to_s)
    end

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